Skip to content

Commit fb28ad3

Browse files
kaysieversdavem330
authored andcommitted
net: struct device - replace bus_id with dev_name(), dev_set_name()
Acked-by: Marcel Holtmann <marcel@holtmann.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2377989 commit fb28ad3

25 files changed

Lines changed: 39 additions & 41 deletions

File tree

‎drivers/net/3c59x.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ static int __devinit vortex_probe1(struct device *gendev,
10251025
}
10261026

10271027
if ((edev = DEVICE_EISA(gendev))) {
1028-
print_name = edev->dev.bus_id;
1028+
print_name = dev_name(&edev->dev);
10291029
}
10301030
}
10311031

@@ -2883,7 +2883,7 @@ static void vortex_get_drvinfo(struct net_device *dev,
28832883
strcpy(info->bus_info, pci_name(VORTEX_PCI(vp)));
28842884
} else {
28852885
if (VORTEX_EISA(vp))
2886-
sprintf(info->bus_info, vp->gendev->bus_id);
2886+
sprintf(info->bus_info, dev_name(vp->gendev));
28872887
else
28882888
sprintf(info->bus_info, "EISA 0x%lx %d",
28892889
dev->base_addr, dev->irq);

‎drivers/net/defxx.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static int __devinit dfx_register(struct device *bdev)
511511
int dfx_bus_pci = DFX_BUS_PCI(bdev);
512512
int dfx_bus_tc = DFX_BUS_TC(bdev);
513513
int dfx_use_mmio = DFX_MMIO || dfx_bus_tc;
514-
char *print_name = bdev->bus_id;
514+
const char *print_name = dev_name(bdev);
515515
struct net_device *dev;
516516
DFX_board_t *bp; /* board pointer */
517517
resource_size_t bar_start = 0; /* pointer to port */

‎drivers/net/enc28j60.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ enc28j60_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
14481448
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
14491449
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
14501450
strlcpy(info->bus_info,
1451-
dev->dev.parent->bus_id, sizeof(info->bus_info));
1451+
dev_name(dev->dev.parent), sizeof(info->bus_info));
14521452
}
14531453

14541454
static int

‎drivers/net/fec_mpc52xx.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static int mpc52xx_fec_init_phy(struct net_device *dev)
216216
struct phy_device *phydev;
217217
char phy_id[BUS_ID_SIZE];
218218

219-
snprintf(phy_id, BUS_ID_SIZE, "%x:%02x",
219+
snprintf(phy_id, sizeof(phy_id), "%x:%02x",
220220
(unsigned int)dev->base_addr, priv->phy_addr);
221221

222222
priv->link = PHY_DOWN;

‎drivers/net/gianfar.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static int init_phy(struct net_device *dev)
546546
priv->oldspeed = 0;
547547
priv->oldduplex = -1;
548548

549-
snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, priv->einfo->bus_id, priv->einfo->phy_id);
549+
snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, priv->einfo->bus_id, priv->einfo->phy_id);
550550

551551
interface = gfar_get_interface(dev);
552552

‎drivers/net/mlx4/mlx4_en.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@
5858
#define mlx4_dbg(mlevel, priv, format, arg...) \
5959
if (NETIF_MSG_##mlevel & priv->msg_enable) \
6060
printk(KERN_DEBUG "%s %s: " format , DRV_NAME ,\
61-
(&priv->mdev->pdev->dev)->bus_id , ## arg)
61+
(dev_name(&priv->mdev->pdev->dev)) , ## arg)
6262

6363
#define mlx4_err(mdev, format, arg...) \
6464
printk(KERN_ERR "%s %s: " format , DRV_NAME ,\
65-
(&mdev->pdev->dev)->bus_id , ## arg)
65+
(dev_name(&mdev->pdev->dev)) , ## arg)
6666
#define mlx4_info(mdev, format, arg...) \
6767
printk(KERN_INFO "%s %s: " format , DRV_NAME ,\
68-
(&mdev->pdev->dev)->bus_id , ## arg)
68+
(dev_name(&mdev->pdev->dev)) , ## arg)
6969
#define mlx4_warn(mdev, format, arg...) \
7070
printk(KERN_WARNING "%s %s: " format , DRV_NAME ,\
71-
(&mdev->pdev->dev)->bus_id , ## arg)
71+
(dev_name(&mdev->pdev->dev)) , ## arg)
7272

7373
/*
7474
* Device constants

‎drivers/net/pasemi_mac.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,8 @@ static int pasemi_mac_phy_init(struct net_device *dev)
11051105
goto err;
11061106

11071107
phy_id = *prop;
1108-
snprintf(mac->phy_id, BUS_ID_SIZE, "%x:%02x", (int)r.start, phy_id);
1108+
snprintf(mac->phy_id, sizeof(mac->phy_id), "%x:%02x",
1109+
(int)r.start, phy_id);
11091110

11101111
of_node_put(phy_dn);
11111112

‎drivers/net/phy/mdio_bus.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int mdiobus_register(struct mii_bus *bus)
9797
bus->dev.parent = bus->parent;
9898
bus->dev.class = &mdio_bus_class;
9999
bus->dev.groups = NULL;
100-
memcpy(bus->dev.bus_id, bus->id, MII_BUS_ID_SIZE);
100+
dev_set_name(&bus->dev, bus->id);
101101

102102
err = device_register(&bus->dev);
103103
if (err) {
@@ -191,7 +191,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
191191

192192
phydev->dev.parent = bus->parent;
193193
phydev->dev.bus = &mdio_bus_type;
194-
snprintf(phydev->dev.bus_id, BUS_ID_SIZE, PHY_ID_FMT, bus->id, addr);
194+
dev_set_name(&phydev->dev, PHY_ID_FMT, bus->id, addr);
195195

196196
phydev->bus = bus;
197197

‎drivers/net/phy/phy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
void phy_print_status(struct phy_device *phydev)
4747
{
48-
pr_info("PHY: %s - Link is %s", phydev->dev.bus_id,
48+
pr_info("PHY: %s - Link is %s", dev_name(&phydev->dev),
4949
phydev->link ? "Up" : "Down");
5050
if (phydev->link)
5151
printk(" - %d/%s", phydev->speed,

‎drivers/net/phy/phy_device.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
7474
if (!fixup)
7575
return -ENOMEM;
7676

77-
strncpy(fixup->bus_id, bus_id, BUS_ID_SIZE);
77+
strlcpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id));
7878
fixup->phy_uid = phy_uid;
7979
fixup->phy_uid_mask = phy_uid_mask;
8080
fixup->run = run;
@@ -109,7 +109,7 @@ EXPORT_SYMBOL(phy_register_fixup_for_id);
109109
*/
110110
static int phy_needs_fixup(struct phy_device *phydev, struct phy_fixup *fixup)
111111
{
112-
if (strcmp(fixup->bus_id, phydev->dev.bus_id) != 0)
112+
if (strcmp(fixup->bus_id, dev_name(&phydev->dev)) != 0)
113113
if (strcmp(fixup->bus_id, PHY_ANY_ID) != 0)
114114
return 0;
115115

0 commit comments

Comments
 (0)