From: Alex Elder Date: Wed, 4 Jan 2023 17:52:32 +0000 (-0600) Subject: net: ipa: kill ipa_interrupt_add() X-Git-Tag: v6.6.7~3490^2~333^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d8d3f1a3ef949a52434520794ef44c5789b8872;p=platform%2Fkernel%2Flinux-starfive.git net: ipa: kill ipa_interrupt_add() 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 Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index a0140d1..b023787 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -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) { diff --git a/drivers/net/ipa/ipa_interrupt.h b/drivers/net/ipa/ipa_interrupt.h index 90b61e0..764a65e 100644 --- a/drivers/net/ipa/ipa_interrupt.h +++ b/drivers/net/ipa/ipa_interrupt.h @@ -14,39 +14,6 @@ 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 * @endpoint_id: Endpoint whose interrupt should be enabled diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 4198f8e..a282512 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -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 */ diff --git a/drivers/net/ipa/ipa_uc.c b/drivers/net/ipa/ipa_uc.c index 6b7d289..cb8a76a 100644 --- a/drivers/net/ipa/ipa_uc.c +++ b/drivers/net/ipa/ipa_uc.c @@ -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);