Commit 59622a8f authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

net: ipa: pass a platform device to ipa_smp2p_irq_init()

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 95c54a96
......@@ -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>
......@@ -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;
......@@ -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;
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment