diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-10-16 12:15:40 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-10-18 09:02:24 +0200 |
commit | 05683764a77ff91419cabe0c26e537589b8a28ff (patch) | |
tree | e51127b561984c8b612c8881b8e943c29c9daddf /drivers/net/phy/phy.c | |
parent | d800b11619bb857ed857df1332c5b6e9c41d6414 (diff) | |
download | barebox-05683764a77ff91419cabe0c26e537589b8a28ff.tar.gz barebox-05683764a77ff91419cabe0c26e537589b8a28ff.tar.xz |
drivers: Introduce dev_set_name()
Introduce dev_set_name() in order to hide implementation details of
setting device's name so it'd be easier to change it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 42dcad9069..19d458e07e 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -176,12 +176,12 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id) phydev->dev.bus = &mdio_bus_type; if (bus) { - sprintf(phydev->dev.name, "mdio%d-phy%02x", - phydev->bus->dev.id, - phydev->addr); + dev_set_name(&phydev->dev, "mdio%d-phy%02x", + phydev->bus->dev.id, + phydev->addr); phydev->dev.id = DEVICE_ID_SINGLE; } else { - sprintf(phydev->dev.name, "fixed-phy"); + dev_set_name(&phydev->dev, "fixed-phy"); phydev->dev.id = DEVICE_ID_DYNAMIC; } |