{
struct ipa_priv *priv = netdev_priv(netdev);
struct ipa *ipa = priv->ipa;
+ struct device *dev;
int ret;
- ret = ipa_clock_get(ipa);
- if (WARN_ON(ret < 0))
- goto err_clock_put;
+ dev = &ipa->pdev->dev;
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0)
+ goto err_power_put;
ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
if (ret)
- goto err_clock_put;
+ goto err_power_put;
ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]);
if (ret)
netif_start_queue(netdev);
- (void)ipa_clock_put(ipa);
+ (void)pm_runtime_put(dev);
return 0;
err_disable_tx:
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
-err_clock_put:
- (void)ipa_clock_put(ipa);
+err_power_put:
+ (void)pm_runtime_put(dev);
return ret;
}
{
struct ipa_priv *priv = netdev_priv(netdev);
struct ipa *ipa = priv->ipa;
+ struct device *dev;
int ret;
- ret = ipa_clock_get(ipa);
- if (WARN_ON(ret < 0))
- goto out_clock_put;
+ dev = &ipa->pdev->dev;
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0)
+ goto out_power_put;
netif_stop_queue(netdev);
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]);
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
-out_clock_put:
- (void)ipa_clock_put(ipa);
+out_power_put:
+ (void)pm_runtime_put(dev);
return 0;
}
struct device *dev = &ipa->pdev->dev;
int ret;
- ret = ipa_clock_get(ipa);
- if (WARN_ON(ret < 0))
- goto out_clock_put;
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0) {
+ dev_err(dev, "error %d getting power to handle crash\n", ret);
+ goto out_power_put;
+ }
ipa_endpoint_modem_pause_all(ipa, true);
if (ret)
dev_err(dev, "error %d zeroing modem memory regions\n", ret);
-out_clock_put:
- (void)ipa_clock_put(ipa);
+out_power_put:
+ (void)pm_runtime_put(dev);
}
static int ipa_modem_notify(struct notifier_block *nb, unsigned long action,