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_init()

Rather than using the platform device pointer field in the IPA
pointer, pass a platform device pointer to ipa_smp2p_init(). Use
that pointer throughout that function.

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
81d65f34 59622a8f

+11 -8
+1 -1
drivers/net/ipa/ipa_main.c
··· 888 888 if (ret) 889 889 goto err_endpoint_exit; 890 890 891 - ret = ipa_smp2p_init(ipa, loader == IPA_LOADER_MODEM); 891 + ret = ipa_smp2p_init(ipa, pdev, loader == IPA_LOADER_MODEM); 892 892 if (ret) 893 893 goto err_table_exit; 894 894
+5 -5
drivers/net/ipa/ipa_smp2p.c
··· 220 220 } 221 221 222 222 /* Initialize the IPA SMP2P subsystem */ 223 - int ipa_smp2p_init(struct ipa *ipa, bool modem_init) 223 + int 224 + ipa_smp2p_init(struct ipa *ipa, struct platform_device *pdev, bool modem_init) 224 225 { 225 226 struct qcom_smem_state *enabled_state; 226 - struct device *dev = &ipa->pdev->dev; 227 + struct device *dev = &pdev->dev; 227 228 struct qcom_smem_state *valid_state; 228 229 struct ipa_smp2p *smp2p; 229 230 u32 enabled_bit; ··· 263 262 /* We have enough information saved to handle notifications */ 264 263 ipa->smp2p = smp2p; 265 264 266 - ret = ipa_smp2p_irq_init(smp2p, smp2p->ipa->pdev, "ipa-clock-query", 265 + ret = ipa_smp2p_irq_init(smp2p, pdev, "ipa-clock-query", 267 266 ipa_smp2p_modem_clk_query_isr); 268 267 if (ret < 0) 269 268 goto err_null_smp2p; ··· 275 274 276 275 if (modem_init) { 277 276 /* Result will be non-zero (negative for error) */ 278 - ret = ipa_smp2p_irq_init(smp2p, smp2p->ipa->pdev, 279 - "ipa-setup-ready", 277 + ret = ipa_smp2p_irq_init(smp2p, pdev, "ipa-setup-ready", 280 278 ipa_smp2p_modem_setup_ready_isr); 281 279 if (ret < 0) 282 280 goto err_notifier_unregister;
+5 -2
drivers/net/ipa/ipa_smp2p.h
··· 8 8 9 9 #include <linux/types.h> 10 10 11 + struct platform_device; 12 + 11 13 struct ipa; 12 14 13 15 /** 14 16 * ipa_smp2p_init() - Initialize the IPA SMP2P subsystem 15 17 * @ipa: IPA pointer 18 + * @pdev: Platform device pointer 16 19 * @modem_init: Whether the modem is responsible for GSI initialization 17 20 * 18 21 * Return: 0 if successful, or a negative error code 19 - * 20 22 */ 21 - int ipa_smp2p_init(struct ipa *ipa, bool modem_init); 23 + int ipa_smp2p_init(struct ipa *ipa, struct platform_device *pdev, 24 + bool modem_init); 22 25 23 26 /** 24 27 * ipa_smp2p_exit() - Inverse of ipa_smp2p_init()