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

net: ipa: add a clock reference for netdev operations

The IPA network device can be opened at any time, and an opened
network device can be stopped any time.  Both of these callback
functions require access to the hardware, and therefore they need
the IPA clock to be operational.  Take an IPA clock reference in
both the ->open and ->stop callback functions, dropping the
reference when they are done accessing hardware.

The ->start_xmit callback requires a little different handling,
and that will be added separately.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34c6034b
...@@ -45,9 +45,12 @@ static int ipa_open(struct net_device *netdev) ...@@ -45,9 +45,12 @@ static int ipa_open(struct net_device *netdev)
struct ipa *ipa = priv->ipa; struct ipa *ipa = priv->ipa;
int ret; int ret;
ipa_clock_get(ipa);
ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
if (ret) if (ret)
return ret; goto err_clock_put;
ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]); ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]);
if (ret) if (ret)
goto err_disable_tx; goto err_disable_tx;
...@@ -58,6 +61,8 @@ static int ipa_open(struct net_device *netdev) ...@@ -58,6 +61,8 @@ static int ipa_open(struct net_device *netdev)
err_disable_tx: err_disable_tx:
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
err_clock_put:
ipa_clock_put(ipa);
return ret; return ret;
} }
...@@ -73,6 +78,8 @@ static int ipa_stop(struct net_device *netdev) ...@@ -73,6 +78,8 @@ static int ipa_stop(struct net_device *netdev)
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]); ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]);
ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]);
ipa_clock_put(ipa);
return 0; return 0;
} }
......
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