mirror of https://github.com/torvalds/linux.git
net: mdio: remove redundant fwnode cleanup
Remove redundant fwnode cleanup in of_mdiobus_register_device() and xpcs_plat_init_dev(). mdio_device_free() eventually calls mdio_device_release(), which already performs fwnode_handle_put(), making the manual cleanup unnecessary. Combine fwnode_handle_get() with device_set_node() in of_mdiobus_register_device() for clarity. Signed-off-by: Buday Csaba <buday.csaba@prolan.hu> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/00847693daa8f7c8ff5dfa19dd35fc712fa4e2b5.1763995734.git.buday.csaba@prolan.hu Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a11e0d467d
commit
ce28e333d6
|
|
@ -63,14 +63,11 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,
|
||||||
/* Associate the OF node with the device structure so it
|
/* Associate the OF node with the device structure so it
|
||||||
* can be looked up later.
|
* can be looked up later.
|
||||||
*/
|
*/
|
||||||
fwnode_handle_get(fwnode);
|
device_set_node(&mdiodev->dev, fwnode_handle_get(fwnode));
|
||||||
device_set_node(&mdiodev->dev, fwnode);
|
|
||||||
|
|
||||||
/* All data is now stored in the mdiodev struct; register it. */
|
/* All data is now stored in the mdiodev struct; register it. */
|
||||||
rc = mdio_device_register(mdiodev);
|
rc = mdio_device_register(mdiodev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
device_set_node(&mdiodev->dev, NULL);
|
|
||||||
fwnode_handle_put(fwnode);
|
|
||||||
mdio_device_free(mdiodev);
|
mdio_device_free(mdiodev);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -365,9 +365,6 @@ static int xpcs_plat_init_dev(struct dw_xpcs_plat *pxpcs)
|
||||||
err_clean_data:
|
err_clean_data:
|
||||||
mdiodev->dev.platform_data = NULL;
|
mdiodev->dev.platform_data = NULL;
|
||||||
|
|
||||||
fwnode_handle_put(dev_fwnode(&mdiodev->dev));
|
|
||||||
device_set_node(&mdiodev->dev, NULL);
|
|
||||||
|
|
||||||
mdio_device_free(mdiodev);
|
mdio_device_free(mdiodev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue