Message ID | 20200923100532.18452-1-tangbin@cmss.chinamobile.com |
---|---|
State | Rejected |
Delegated to: | David Miller |
Headers | show |
Series | net: mdio: Remove redundant parameter and check | expand |
From: Tang Bin <tangbin@cmss.chinamobile.com> Date: Wed, 23 Sep 2020 18:05:32 +0800 > @@ -125,12 +124,9 @@ ipq8064_mdio_probe(struct platform_device *pdev) > return PTR_ERR(priv->base); > } > > - ret = of_mdiobus_register(bus, np); > - if (ret) > - return ret; > - > platform_set_drvdata(pdev, bus); > - return 0; > + > + return of_mdiobus_register(bus, np); > } You are changing the code rather than simplifying the return sequence. The author of this code intended the platform_set_drvdata() to only happen if all operations of this function succeeded. I am not applying this patch, sorry.
diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c index 1bd1885..33cccce 100644 --- a/drivers/net/mdio/mdio-ipq8064.c +++ b/drivers/net/mdio/mdio-ipq8064.c @@ -102,7 +102,6 @@ ipq8064_mdio_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct ipq8064_mdio *priv; struct mii_bus *bus; - int ret; bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); if (!bus) @@ -125,12 +124,9 @@ ipq8064_mdio_probe(struct platform_device *pdev) return PTR_ERR(priv->base); } - ret = of_mdiobus_register(bus, np); - if (ret) - return ret; - platform_set_drvdata(pdev, bus); - return 0; + + return of_mdiobus_register(bus, np); } static int