Re: [PATCH v2 3/4] net: macb: Add pm runtime support

From: Andrew Lunn
Date: Mon Nov 26 2018 - 09:47:17 EST


> @@ -335,6 +338,10 @@ static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
> int value;
> int err;
>
> + err = pm_runtime_get_sync(&bp->pdev->dev);
> + if (err < 0)
> + return err;
> +
> err = macb_mdio_wait_for_idle(bp);
> if (err < 0)
> return err;

Hi Harini

Thanks for adding runtime PM support to the MDIO bus.

It looks like on the error paths you are not always undoing the
pm_runtime_get_sync(). You probably need some sort of goto err;
construct. macb_mdio_write() has the same issue.

Andrew