Message ID | 20190725093320.8136-2-alexandru.marginean@nxp.com |
---|---|
State | Accepted |
Commit | 6b3abc048228bb4336dd0cc761993353a4efb206 |
Delegated to: | Joe Hershberger |
Headers | show |
Series | Marvell MDIO driver and new MDIO name property | expand |
Hi Alex, https://patchwork.ozlabs.org/patch/1136774/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git Thanks! -Joe
diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c index 36a404ff44..428f3a994f 100644 --- a/net/mdio-uclass.c +++ b/net/mdio-uclass.c @@ -23,6 +23,17 @@ void dm_mdio_probe_devices(void) static int dm_mdio_post_bind(struct udevice *dev) { + const char *dt_name; + + /* set a custom name for the MDIO device, if present in DT */ + if (ofnode_valid(dev->node)) { + dt_name = ofnode_read_string(dev->node, "device-name"); + if (dt_name) { + debug("renaming dev %s to %s\n", dev->name, dt_name); + device_set_name(dev, dt_name); + } + } + /* * MDIO command doesn't like spaces in names, don't allow them to keep * it happy