Commit b66bfc13 authored by Minghao Chi's avatar Minghao Chi Committed by Jakub Kicinski

net/cadence: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get is more appropriate
for simplifing code
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi <chi.minghao@zte.com.cn>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220411013812.2517212-1-chi.minghao@zte.com.cnSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b8ff3395
...@@ -337,11 +337,9 @@ static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum) ...@@ -337,11 +337,9 @@ static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
struct macb *bp = bus->priv; struct macb *bp = bus->priv;
int status; int status;
status = pm_runtime_get_sync(&bp->pdev->dev); status = pm_runtime_resume_and_get(&bp->pdev->dev);
if (status < 0) { if (status < 0)
pm_runtime_put_noidle(&bp->pdev->dev);
goto mdio_pm_exit; goto mdio_pm_exit;
}
status = macb_mdio_wait_for_idle(bp); status = macb_mdio_wait_for_idle(bp);
if (status < 0) if (status < 0)
...@@ -391,11 +389,9 @@ static int macb_mdio_write(struct mii_bus *bus, int mii_id, int regnum, ...@@ -391,11 +389,9 @@ static int macb_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
struct macb *bp = bus->priv; struct macb *bp = bus->priv;
int status; int status;
status = pm_runtime_get_sync(&bp->pdev->dev); status = pm_runtime_resume_and_get(&bp->pdev->dev);
if (status < 0) { if (status < 0)
pm_runtime_put_noidle(&bp->pdev->dev);
goto mdio_pm_exit; goto mdio_pm_exit;
}
status = macb_mdio_wait_for_idle(bp); status = macb_mdio_wait_for_idle(bp);
if (status < 0) if (status < 0)
...@@ -2745,9 +2741,9 @@ static int macb_open(struct net_device *dev) ...@@ -2745,9 +2741,9 @@ static int macb_open(struct net_device *dev)
netdev_dbg(bp->dev, "open\n"); netdev_dbg(bp->dev, "open\n");
err = pm_runtime_get_sync(&bp->pdev->dev); err = pm_runtime_resume_and_get(&bp->pdev->dev);
if (err < 0) if (err < 0)
goto pm_exit; return err;
/* RX buffers initialization */ /* RX buffers initialization */
macb_init_rx_buffer_size(bp, bufsz); macb_init_rx_buffer_size(bp, bufsz);
...@@ -4134,11 +4130,9 @@ static int at91ether_open(struct net_device *dev) ...@@ -4134,11 +4130,9 @@ static int at91ether_open(struct net_device *dev)
u32 ctl; u32 ctl;
int ret; int ret;
ret = pm_runtime_get_sync(&lp->pdev->dev); ret = pm_runtime_resume_and_get(&lp->pdev->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(&lp->pdev->dev);
return ret; return ret;
}
/* Clear internal statistics */ /* Clear internal statistics */
ctl = macb_readl(lp, NCR); ctl = macb_readl(lp, NCR);
......
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