Commit 2222c313 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

sparc64: fix up bus_id changes in sparc core code

This converts all instances of bus_id in the sparc core kernel to use
either dev_set_name(), or dev_name() depending on the need.

This is done in anticipation of removing the bus_id field from struct
driver.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 361d5ee3
...@@ -401,7 +401,7 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de ...@@ -401,7 +401,7 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de
dev->ofdev.node = dp; dev->ofdev.node = dp;
dev->ofdev.dev.parent = &dev->bus->ofdev.dev; dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
dev->ofdev.dev.bus = &ebus_bus_type; dev->ofdev.dev.bus = &ebus_bus_type;
sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node); dev_set_name(&dev->ofdev.dev, "ebus[%08x]", dp->node);
/* Register with core */ /* Register with core */
if (of_device_register(&dev->ofdev) != 0) if (of_device_register(&dev->ofdev) != 0)
...@@ -501,7 +501,7 @@ void __init ebus_init(void) ...@@ -501,7 +501,7 @@ void __init ebus_init(void)
ebus->ofdev.node = dp; ebus->ofdev.node = dp;
ebus->ofdev.dev.parent = &pdev->dev; ebus->ofdev.dev.parent = &pdev->dev;
ebus->ofdev.dev.bus = &ebus_bus_type; ebus->ofdev.dev.bus = &ebus_bus_type;
sprintf(ebus->ofdev.dev.bus_id, "ebus%d", num_ebus); dev_set_name(&ebus->ofdev.dev, "ebus%d", num_ebus);
/* Register with core */ /* Register with core */
if (of_device_register(&ebus->ofdev) != 0) if (of_device_register(&ebus->ofdev) != 0)
......
...@@ -797,9 +797,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp, ...@@ -797,9 +797,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
op->dev.parent = parent; op->dev.parent = parent;
op->dev.bus = &of_platform_bus_type; op->dev.bus = &of_platform_bus_type;
if (!parent) if (!parent)
strcpy(op->dev.bus_id, "root"); dev_set_name(&op->dev, "root");
else else
sprintf(op->dev.bus_id, "%08x", dp->node); dev_set_name(&op->dev, "%08x", dp->node);
if (of_device_register(op)) { if (of_device_register(op)) {
printk("%s: Could not register of device.\n", printk("%s: Could not register of device.\n",
......
...@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, ...@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
dev->class = class >> 8; dev->class = class >> 8;
dev->revision = class & 0xff; dev->revision = class & 0xff;
sprintf(dev->dev.bus_id, "%04x:%02x:%02x.%d", pci_domain_nr(bus), dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus),
dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
if (ofpci_verbose) if (ofpci_verbose)
......
...@@ -260,16 +260,14 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, ...@@ -260,16 +260,14 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
vio_fill_channel_info(hp, mp, vdev); vio_fill_channel_info(hp, mp, vdev);
if (!id) { if (!id) {
snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s", dev_set_name(&vdev->dev, "%s", bus_id_name);
bus_id_name);
vdev->dev_no = ~(u64)0; vdev->dev_no = ~(u64)0;
} else if (!cfg_handle) { } else if (!cfg_handle) {
snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu", dev_set_name(&vdev->dev, "%s-%lu", bus_id_name, *id);
bus_id_name, *id);
vdev->dev_no = *id; vdev->dev_no = *id;
} else { } else {
snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu-%lu", dev_set_name(&vdev->dev, "%s-%lu-%lu", bus_id_name,
bus_id_name, *cfg_handle, *id); *cfg_handle, *id);
vdev->dev_no = *cfg_handle; vdev->dev_no = *cfg_handle;
} }
...@@ -292,12 +290,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, ...@@ -292,12 +290,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
} }
vdev->dp = dp; vdev->dp = dp;
printk(KERN_INFO "VIO: Adding device %s\n", vdev->dev.bus_id); printk(KERN_INFO "VIO: Adding device %s\n", dev_name(&vdev->dev));
err = device_register(&vdev->dev); err = device_register(&vdev->dev);
if (err) { if (err) {
printk(KERN_ERR "VIO: Could not register device %s, err=%d\n", printk(KERN_ERR "VIO: Could not register device %s, err=%d\n",
vdev->dev.bus_id, err); dev_name(&vdev->dev), err);
kfree(vdev); kfree(vdev);
return NULL; return NULL;
} }
...@@ -330,7 +328,7 @@ static void vio_remove(struct mdesc_handle *hp, u64 node) ...@@ -330,7 +328,7 @@ static void vio_remove(struct mdesc_handle *hp, u64 node)
dev = device_find_child(&root_vdev->dev, (void *) node, dev = device_find_child(&root_vdev->dev, (void *) node,
vio_md_node_match); vio_md_node_match);
if (dev) { if (dev) {
printk(KERN_INFO "VIO: Removing device %s\n", dev->bus_id); printk(KERN_INFO "VIO: Removing device %s\n", dev_name(dev));
device_unregister(dev); device_unregister(dev);
} }
......
...@@ -78,7 +78,7 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde ...@@ -78,7 +78,7 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
else else
sdev->ofdev.dev.parent = &sdev->bus->ofdev.dev; sdev->ofdev.dev.parent = &sdev->bus->ofdev.dev;
sdev->ofdev.dev.bus = &sbus_bus_type; sdev->ofdev.dev.bus = &sbus_bus_type;
sprintf(sdev->ofdev.dev.bus_id, "sbus[%08x]", dp->node); dev_set_name(&sdev->ofdev.dev, "sbus[%08x]", dp->node);
if (of_device_register(&sdev->ofdev) != 0) if (of_device_register(&sdev->ofdev) != 0)
printk(KERN_DEBUG "sbus: device registration error for %s!\n", printk(KERN_DEBUG "sbus: device registration error for %s!\n",
...@@ -257,11 +257,11 @@ static void __init build_one_sbus(struct device_node *dp, int num_sbus) ...@@ -257,11 +257,11 @@ static void __init build_one_sbus(struct device_node *dp, int num_sbus)
sbus->ofdev.node = dp; sbus->ofdev.node = dp;
sbus->ofdev.dev.parent = NULL; sbus->ofdev.dev.parent = NULL;
sbus->ofdev.dev.bus = &sbus_bus_type; sbus->ofdev.dev.bus = &sbus_bus_type;
sprintf(sbus->ofdev.dev.bus_id, "sbus%d", num_sbus); dev_set_name(&sbus->ofdev.dev, "sbus%d", num_sbus);
if (of_device_register(&sbus->ofdev) != 0) if (of_device_register(&sbus->ofdev) != 0)
printk(KERN_DEBUG "sbus: device registration error for %s!\n", printk(KERN_DEBUG "sbus: device registration error for %s!\n",
sbus->ofdev.dev.bus_id); dev_name(&sbus->ofdev.dev));
dev_dp = dp->child; dev_dp = dp->child;
while (dev_dp) { while (dev_dp) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment