summaryrefslogtreecommitdiff
path: root/drivers/net/ipa/ipa_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ipa/ipa_main.c')
-rw-r--r--drivers/net/ipa/ipa_main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
index 5bcc6cd13a9a..67aba68e6e3b 100644
--- a/drivers/net/ipa/ipa_main.c
+++ b/drivers/net/ipa/ipa_main.c
@@ -770,9 +770,12 @@ static int ipa_probe(struct platform_device *pdev)
if (ret)
goto err_table_exit;
+ /* The clock needs to be active for config and setup */
+ ipa_clock_get(ipa);
+
ret = ipa_config(ipa, data);
if (ret)
- goto err_modem_exit;
+ goto err_clock_put; /* Error */
dev_info(dev, "IPA driver initialized");
@@ -781,7 +784,7 @@ static int ipa_probe(struct platform_device *pdev)
* we're done here.
*/
if (modem_init)
- return 0;
+ goto out_clock_put; /* Done; no error */
/* Otherwise we need to load the firmware and have Trust Zone validate
* and install it. If that succeeds we can proceed with setup.
@@ -794,11 +797,15 @@ static int ipa_probe(struct platform_device *pdev)
if (ret)
goto err_deconfig;
+out_clock_put:
+ ipa_clock_put(ipa);
+
return 0;
err_deconfig:
ipa_deconfig(ipa);
-err_modem_exit:
+err_clock_put:
+ ipa_clock_put(ipa);
ipa_modem_exit(ipa);
err_table_exit:
ipa_table_exit(ipa);
@@ -824,6 +831,8 @@ static int ipa_remove(struct platform_device *pdev)
struct ipa_clock *clock = ipa->clock;
int ret;
+ ipa_clock_get(ipa);
+
if (ipa->setup_complete) {
ret = ipa_modem_stop(ipa);
/* If starting or stopping is in progress, try once more */
@@ -838,6 +847,9 @@ static int ipa_remove(struct platform_device *pdev)
}
ipa_deconfig(ipa);
+
+ ipa_clock_put(ipa);
+
ipa_modem_exit(ipa);
ipa_table_exit(ipa);
ipa_endpoint_exit(ipa);