diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-02 00:02:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-22 00:55:03 -0400 |
commit | 2222c313e9371b6476787594bc5804c72cee2597 (patch) | |
tree | bb0e00406e5f8ba624341b8d7bb9caf8a557fce5 /arch/sparc64 | |
parent | 361d5ee3c04c43c8fa0e277545ac5258dc310a5e (diff) |
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: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/ebus.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/of_device.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/vio.c | 16 |
4 files changed, 12 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index c49d0388b793..4d58d7ce708d 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c | |||
@@ -401,7 +401,7 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de | |||
401 | dev->ofdev.node = dp; | 401 | dev->ofdev.node = dp; |
402 | dev->ofdev.dev.parent = &dev->bus->ofdev.dev; | 402 | dev->ofdev.dev.parent = &dev->bus->ofdev.dev; |
403 | dev->ofdev.dev.bus = &ebus_bus_type; | 403 | dev->ofdev.dev.bus = &ebus_bus_type; |
404 | sprintf(dev->ofdev.dev.bus_id, "ebus[%08x]", dp->node); | 404 | dev_set_name(&dev->ofdev.dev, "ebus[%08x]", dp->node); |
405 | 405 | ||
406 | /* Register with core */ | 406 | /* Register with core */ |
407 | if (of_device_register(&dev->ofdev) != 0) | 407 | if (of_device_register(&dev->ofdev) != 0) |
@@ -501,7 +501,7 @@ void __init ebus_init(void) | |||
501 | ebus->ofdev.node = dp; | 501 | ebus->ofdev.node = dp; |
502 | ebus->ofdev.dev.parent = &pdev->dev; | 502 | ebus->ofdev.dev.parent = &pdev->dev; |
503 | ebus->ofdev.dev.bus = &ebus_bus_type; | 503 | ebus->ofdev.dev.bus = &ebus_bus_type; |
504 | sprintf(ebus->ofdev.dev.bus_id, "ebus%d", num_ebus); | 504 | dev_set_name(&ebus->ofdev.dev, "ebus%d", num_ebus); |
505 | 505 | ||
506 | /* Register with core */ | 506 | /* Register with core */ |
507 | if (of_device_register(&ebus->ofdev) != 0) | 507 | if (of_device_register(&ebus->ofdev) != 0) |
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index d569f60c24b8..4fd48ab7dda4 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c | |||
@@ -797,9 +797,9 @@ static struct of_device * __init scan_one_device(struct device_node *dp, | |||
797 | op->dev.parent = parent; | 797 | op->dev.parent = parent; |
798 | op->dev.bus = &of_platform_bus_type; | 798 | op->dev.bus = &of_platform_bus_type; |
799 | if (!parent) | 799 | if (!parent) |
800 | strcpy(op->dev.bus_id, "root"); | 800 | dev_set_name(&op->dev, "root"); |
801 | else | 801 | else |
802 | sprintf(op->dev.bus_id, "%08x", dp->node); | 802 | dev_set_name(&op->dev, "%08x", dp->node); |
803 | 803 | ||
804 | if (of_device_register(op)) { | 804 | if (of_device_register(op)) { |
805 | printk("%s: Could not register of device.\n", | 805 | printk("%s: Could not register of device.\n", |
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index d00a3656c287..55096195458f 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
408 | dev->class = class >> 8; | 408 | dev->class = class >> 8; |
409 | dev->revision = class & 0xff; | 409 | dev->revision = class & 0xff; |
410 | 410 | ||
411 | sprintf(dev->dev.bus_id, "%04x:%02x:%02x.%d", pci_domain_nr(bus), | 411 | dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus), |
412 | dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); | 412 | dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); |
413 | 413 | ||
414 | if (ofpci_verbose) | 414 | if (ofpci_verbose) |
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c index ecbb8b618b8c..a490077891a4 100644 --- a/arch/sparc64/kernel/vio.c +++ b/arch/sparc64/kernel/vio.c | |||
@@ -260,16 +260,14 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, | |||
260 | vio_fill_channel_info(hp, mp, vdev); | 260 | vio_fill_channel_info(hp, mp, vdev); |
261 | 261 | ||
262 | if (!id) { | 262 | if (!id) { |
263 | snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s", | 263 | dev_set_name(&vdev->dev, "%s", bus_id_name); |
264 | bus_id_name); | ||
265 | vdev->dev_no = ~(u64)0; | 264 | vdev->dev_no = ~(u64)0; |
266 | } else if (!cfg_handle) { | 265 | } else if (!cfg_handle) { |
267 | snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu", | 266 | dev_set_name(&vdev->dev, "%s-%lu", bus_id_name, *id); |
268 | bus_id_name, *id); | ||
269 | vdev->dev_no = *id; | 267 | vdev->dev_no = *id; |
270 | } else { | 268 | } else { |
271 | snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu-%lu", | 269 | dev_set_name(&vdev->dev, "%s-%lu-%lu", bus_id_name, |
272 | bus_id_name, *cfg_handle, *id); | 270 | *cfg_handle, *id); |
273 | vdev->dev_no = *cfg_handle; | 271 | vdev->dev_no = *cfg_handle; |
274 | } | 272 | } |
275 | 273 | ||
@@ -292,12 +290,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, | |||
292 | } | 290 | } |
293 | vdev->dp = dp; | 291 | vdev->dp = dp; |
294 | 292 | ||
295 | printk(KERN_INFO "VIO: Adding device %s\n", vdev->dev.bus_id); | 293 | printk(KERN_INFO "VIO: Adding device %s\n", dev_name(&vdev->dev)); |
296 | 294 | ||
297 | err = device_register(&vdev->dev); | 295 | err = device_register(&vdev->dev); |
298 | if (err) { | 296 | if (err) { |
299 | printk(KERN_ERR "VIO: Could not register device %s, err=%d\n", | 297 | printk(KERN_ERR "VIO: Could not register device %s, err=%d\n", |
300 | vdev->dev.bus_id, err); | 298 | dev_name(&vdev->dev), err); |
301 | kfree(vdev); | 299 | kfree(vdev); |
302 | return NULL; | 300 | return NULL; |
303 | } | 301 | } |
@@ -330,7 +328,7 @@ static void vio_remove(struct mdesc_handle *hp, u64 node) | |||
330 | dev = device_find_child(&root_vdev->dev, (void *) node, | 328 | dev = device_find_child(&root_vdev->dev, (void *) node, |
331 | vio_md_node_match); | 329 | vio_md_node_match); |
332 | if (dev) { | 330 | if (dev) { |
333 | printk(KERN_INFO "VIO: Removing device %s\n", dev->bus_id); | 331 | printk(KERN_INFO "VIO: Removing device %s\n", dev_name(dev)); |
334 | 332 | ||
335 | device_unregister(dev); | 333 | device_unregister(dev); |
336 | } | 334 | } |