Commit e6ec8379 authored by Minghao Chi's avatar Minghao Chi Committed by Marc Kleine-Budde

can: flexcan: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Link: https://lore.kernel.org/all/20220419081449.2574026-1-chi.minghao@zte.com.cnReported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent bb75e352
...@@ -723,11 +723,9 @@ static int flexcan_get_berr_counter(const struct net_device *dev, ...@@ -723,11 +723,9 @@ static int flexcan_get_berr_counter(const struct net_device *dev,
const struct flexcan_priv *priv = netdev_priv(dev); const struct flexcan_priv *priv = netdev_priv(dev);
int err; int err;
err = pm_runtime_get_sync(priv->dev); err = pm_runtime_resume_and_get(priv->dev);
if (err < 0) { if (err < 0)
pm_runtime_put_noidle(priv->dev);
return err; return err;
}
err = __flexcan_get_berr_counter(dev, bec); err = __flexcan_get_berr_counter(dev, bec);
...@@ -1700,11 +1698,9 @@ static int flexcan_open(struct net_device *dev) ...@@ -1700,11 +1698,9 @@ static int flexcan_open(struct net_device *dev)
return -EINVAL; return -EINVAL;
} }
err = pm_runtime_get_sync(priv->dev); err = pm_runtime_resume_and_get(priv->dev);
if (err < 0) { if (err < 0)
pm_runtime_put_noidle(priv->dev);
return err; return err;
}
err = open_candev(dev); err = open_candev(dev);
if (err) if (err)
......
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