Re: [PATCH 3/3] net: Convert more users of mdiobus_* to mdiodev_*

From: Florian Fainelli
Date: Mon Oct 18 2021 - 18:09:47 EST


On 10/18/21 2:54 PM, Sean Anderson wrote:
> This converts users of mdiobus to mdiodev using the following semantic
> patch:
>
> @@
> identifier mdiodev;
> expression regnum;
> @@
>
> - mdiobus_read(mdiodev->bus, mdiodev->addr, regnum)
> + mdiodev_read(mdiodev, regnum)
>
> @@
> identifier mdiodev;
> expression regnum, val;
> @@
>
> - mdiobus_write(mdiodev->bus, mdiodev->addr, regnum, val)
> + mdiodev_write(mdiodev, regnum, val)
>
> Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxx>
> ---
> I am not too experienced with coccinelle, so pointers would be
> appreciated. In particular, is it possible to convert things like
>
> bus = mdiodev->bus;
> addr = mdiodev->addr;
> mdiobus_foo(bus, addr, ...);
>
> in a generic way?
>
> drivers/base/regmap/regmap-mdio.c | 6 +++---
> drivers/net/dsa/xrs700x/xrs700x_mdio.c | 12 ++++++------
> drivers/phy/broadcom/phy-bcm-ns-usb3.c | 2 +-
> drivers/phy/broadcom/phy-bcm-ns2-pcie.c | 6 ++----

For the two above:

Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
--
Florian