]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: ipa: kill ipa_interrupt_add()
authorAlex Elder <elder@linaro.org>
Wed, 4 Jan 2023 17:52:32 +0000 (11:52 -0600)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Jan 2023 06:03:14 +0000 (22:03 -0800)
The dynamic assignment of IPA interrupt handlers isn't needed; we
only handle three IPA interrupt types, and their handler functions
are now assigned directly.  We can get rid of ipa_interrupt_add()
and ipa_interrupt_remove() now, because they serve no purpose.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_interrupt.c
drivers/net/ipa/ipa_interrupt.h
drivers/net/ipa/ipa_power.c
drivers/net/ipa/ipa_uc.c

index a0140d1d59502bd6b850a50d2f30dedea55352ee..b023787baedcb5b9f7c3ece1ebe3e4328676c2ea 100644 (file)
@@ -30,6 +30,8 @@
 #include "ipa_uc.h"
 #include "ipa_interrupt.h"
 
+typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id);
+
 /**
  * struct ipa_interrupt - IPA interrupt information
  * @ipa:               IPA pointer
@@ -225,20 +227,6 @@ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt)
        ipa_interrupt_process(interrupt, IPA_IRQ_TX_SUSPEND);
 }
 
-/* Add a handler for an IPA interrupt */
-void ipa_interrupt_add(struct ipa_interrupt *interrupt,
-                      enum ipa_irq_id ipa_irq, ipa_irq_handler_t handler)
-{
-       WARN_ON(ipa_irq >= IPA_IRQ_COUNT);
-}
-
-/* Remove the handler for an IPA interrupt type */
-void
-ipa_interrupt_remove(struct ipa_interrupt *interrupt, enum ipa_irq_id ipa_irq)
-{
-       WARN_ON(ipa_irq >= IPA_IRQ_COUNT);
-}
-
 /* Configure the IPA interrupt framework */
 struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa)
 {
index 90b61e013064bcbdd2c5d7d13758c407bb7ee9d3..764a65e6b5036214762e76c739b15e7e795e226e 100644 (file)
@@ -13,39 +13,6 @@ struct ipa;
 struct ipa_interrupt;
 enum ipa_irq_id;
 
-/**
- * typedef ipa_irq_handler_t - IPA interrupt handler function type
- * @ipa:       IPA pointer
- * @irq_id:    interrupt type
- *
- * Callback function registered by ipa_interrupt_add() to handle a specific
- * IPA interrupt type
- */
-typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id);
-
-/**
- * ipa_interrupt_add() - Register a handler for an IPA interrupt type
- * @interrupt: IPA interrupt structure
- * @irq_id:    IPA interrupt type
- * @handler:   Handler function for the interrupt
- *
- * Add a handler for an IPA interrupt and enable it.  IPA interrupt
- * handlers are run in threaded interrupt context, so are allowed to
- * block.
- */
-void ipa_interrupt_add(struct ipa_interrupt *interrupt, enum ipa_irq_id irq_id,
-                      ipa_irq_handler_t handler);
-
-/**
- * ipa_interrupt_remove() - Remove the handler for an IPA interrupt type
- * @interrupt: IPA interrupt structure
- * @irq_id:    IPA interrupt type
- *
- * Remove an IPA interrupt handler and disable it.
- */
-void ipa_interrupt_remove(struct ipa_interrupt *interrupt,
-                         enum ipa_irq_id irq_id);
-
 /**
  * ipa_interrupt_suspend_enable - Enable TX_SUSPEND for an endpoint
  * @interrupt:         IPA interrupt structure
index 4198f8e97e40b7e48ba3af5011f82331581d9bbe..a282512ebd2d8bd7ced14181326ead9b0d2604fa 100644 (file)
@@ -325,15 +325,11 @@ int ipa_power_setup(struct ipa *ipa)
 {
        int ret;
 
-       ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND,
-                         ipa_power_suspend_handler);
        ipa_interrupt_enable(ipa, IPA_IRQ_TX_SUSPEND);
 
        ret = device_init_wakeup(&ipa->pdev->dev, true);
-       if (ret) {
+       if (ret)
                ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND);
-               ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND);
-       }
 
        return ret;
 }
@@ -342,7 +338,6 @@ void ipa_power_teardown(struct ipa *ipa)
 {
        (void)device_init_wakeup(&ipa->pdev->dev, false);
        ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND);
-       ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND);
 }
 
 /* Initialize IPA power management */
index 6b7d289cfaffa9448408194eed7f0eab9e4bca33..cb8a76a75f21dccb1d828f832ada20b05b7b11c4 100644 (file)
@@ -182,13 +182,9 @@ void ipa_uc_interrupt_handler(struct ipa *ipa, enum ipa_irq_id irq_id)
 /* Configure the IPA microcontroller subsystem */
 void ipa_uc_config(struct ipa *ipa)
 {
-       struct ipa_interrupt *interrupt = ipa->interrupt;
-
        ipa->uc_powered = false;
        ipa->uc_loaded = false;
-       ipa_interrupt_add(interrupt, IPA_IRQ_UC_0, ipa_uc_interrupt_handler);
        ipa_interrupt_enable(ipa, IPA_IRQ_UC_0);
-       ipa_interrupt_add(interrupt, IPA_IRQ_UC_1, ipa_uc_interrupt_handler);
        ipa_interrupt_enable(ipa, IPA_IRQ_UC_1);
 }
 
@@ -198,9 +194,7 @@ void ipa_uc_deconfig(struct ipa *ipa)
        struct device *dev = &ipa->pdev->dev;
 
        ipa_interrupt_disable(ipa, IPA_IRQ_UC_1);
-       ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1);
        ipa_interrupt_disable(ipa, IPA_IRQ_UC_0);
-       ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0);
        if (ipa->uc_loaded)
                ipa_power_retention(ipa, false);