Skip to content

Commit

Permalink
net: ipa: pass a platform device to ipa_smp2p_irq_init()
Browse files Browse the repository at this point in the history
Rather than using the platform device pointer field in the IPA
pointer, pass a platform device pointer to ipa_smp2p_irq_init().
Use that pointer throughout that function (without assuming it's
the same as the IPA platform device pointer).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alex Elder authored and David S. Miller committed Mar 4, 2024
1 parent 95c54a9 commit 59622a8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/net/ipa/ipa_smp2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <linux/types.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <linux/panic_notifier.h>
Expand Down Expand Up @@ -179,14 +179,15 @@ static irqreturn_t ipa_smp2p_modem_setup_ready_isr(int irq, void *dev_id)
}

/* Initialize SMP2P interrupts */
static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name,
irq_handler_t handler)
static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p,
struct platform_device *pdev,
const char *name, irq_handler_t handler)
{
struct device *dev = &smp2p->ipa->pdev->dev;
struct device *dev = &pdev->dev;
unsigned int irq;
int ret;

ret = platform_get_irq_byname(smp2p->ipa->pdev, name);
ret = platform_get_irq_byname(pdev, name);
if (ret <= 0)
return ret ? : -EINVAL;
irq = ret;
Expand Down Expand Up @@ -261,7 +262,7 @@ int ipa_smp2p_init(struct ipa *ipa, bool modem_init)
/* We have enough information saved to handle notifications */
ipa->smp2p = smp2p;

ret = ipa_smp2p_irq_init(smp2p, "ipa-clock-query",
ret = ipa_smp2p_irq_init(smp2p, smp2p->ipa->pdev, "ipa-clock-query",
ipa_smp2p_modem_clk_query_isr);
if (ret < 0)
goto err_null_smp2p;
Expand All @@ -273,7 +274,8 @@ int ipa_smp2p_init(struct ipa *ipa, bool modem_init)

if (modem_init) {
/* Result will be non-zero (negative for error) */
ret = ipa_smp2p_irq_init(smp2p, "ipa-setup-ready",
ret = ipa_smp2p_irq_init(smp2p, smp2p->ipa->pdev,
"ipa-setup-ready",
ipa_smp2p_modem_setup_ready_isr);
if (ret < 0)
goto err_notifier_unregister;
Expand Down

0 comments on commit 59622a8

Please sign in to comment.