Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alex Elder and committed by
David S. Miller
59622a8f 95c54a96

+9 -7
+9 -7
drivers/net/ipa/ipa_smp2p.c
··· 5 5 */ 6 6 7 7 #include <linux/types.h> 8 - #include <linux/device.h> 8 + #include <linux/platform_device.h> 9 9 #include <linux/interrupt.h> 10 10 #include <linux/notifier.h> 11 11 #include <linux/panic_notifier.h> ··· 179 179 } 180 180 181 181 /* Initialize SMP2P interrupts */ 182 - static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name, 183 - irq_handler_t handler) 182 + static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, 183 + struct platform_device *pdev, 184 + const char *name, irq_handler_t handler) 184 185 { 185 - struct device *dev = &smp2p->ipa->pdev->dev; 186 + struct device *dev = &pdev->dev; 186 187 unsigned int irq; 187 188 int ret; 188 189 189 - ret = platform_get_irq_byname(smp2p->ipa->pdev, name); 190 + ret = platform_get_irq_byname(pdev, name); 190 191 if (ret <= 0) 191 192 return ret ? : -EINVAL; 192 193 irq = ret; ··· 262 261 /* We have enough information saved to handle notifications */ 263 262 ipa->smp2p = smp2p; 264 263 265 - ret = ipa_smp2p_irq_init(smp2p, "ipa-clock-query", 264 + ret = ipa_smp2p_irq_init(smp2p, smp2p->ipa->pdev, "ipa-clock-query", 266 265 ipa_smp2p_modem_clk_query_isr); 267 266 if (ret < 0) 268 267 goto err_null_smp2p; ··· 274 273 275 274 if (modem_init) { 276 275 /* Result will be non-zero (negative for error) */ 277 - ret = ipa_smp2p_irq_init(smp2p, "ipa-setup-ready", 276 + ret = ipa_smp2p_irq_init(smp2p, smp2p->ipa->pdev, 277 + "ipa-setup-ready", 278 278 ipa_smp2p_modem_setup_ready_isr); 279 279 if (ret < 0) 280 280 goto err_notifier_unregister;