aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-29 21:17:49 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 14:12:23 -0500
commit1a9271331ab663f3c7cda78d86b884f2ea86d4d7 (patch)
tree8d9334c0f1108fd785d5026a7eb9f6a2e95d3975 /drivers/pci/probe.c
parentbfb0f330a6c833fd12c35b907434256b4211a1dc (diff)
PCI: struct device - replace bus_id with dev_name(), dev_set_name()
This patch is part of a larger patch series which will remove the "char bus_id[20]" name string from struct device. The device name is managed in the kobject anyway, and without any size limitation, and just needlessly copied into "struct device". To set and read the device name dev_name(dev) and dev_set_name(dev) must be used. If your code uses static kobjects, which it shouldn't do, "const char *init_name" can be used to statically provide the name the registered device should have. At registration time, the init_name field is cleared, to enforce the use of dev_name(dev) to access the device name at a later time. We need to get rid of all occurrences of bus_id in the entire tree to be able to enable the new interface. Please apply this patch, and possibly convert any remaining remaining occurrences of bus_id. Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5b3f5937ecf..eb2b985beb4 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -412,7 +412,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
412 * registered later in pci_bus_add_devices() 412 * registered later in pci_bus_add_devices()
413 */ 413 */
414 child->dev.class = &pcibus_class; 414 child->dev.class = &pcibus_class;
415 sprintf(child->dev.bus_id, "%04x:%02x", pci_domain_nr(child), busnr); 415 dev_set_name(&child->dev, "%04x:%02x", pci_domain_nr(child), busnr);
416 416
417 /* 417 /*
418 * Set up the primary, secondary and subordinate 418 * Set up the primary, secondary and subordinate
@@ -1130,7 +1130,7 @@ struct pci_bus * pci_create_bus(struct device *parent,
1130 memset(dev, 0, sizeof(*dev)); 1130 memset(dev, 0, sizeof(*dev));
1131 dev->parent = parent; 1131 dev->parent = parent;
1132 dev->release = pci_release_bus_bridge_dev; 1132 dev->release = pci_release_bus_bridge_dev;
1133 sprintf(dev->bus_id, "pci%04x:%02x", pci_domain_nr(b), bus); 1133 dev_set_name(dev, "pci%04x:%02x", pci_domain_nr(b), bus);
1134 error = device_register(dev); 1134 error = device_register(dev);
1135 if (error) 1135 if (error)
1136 goto dev_reg_err; 1136 goto dev_reg_err;
@@ -1141,7 +1141,7 @@ struct pci_bus * pci_create_bus(struct device *parent,
1141 1141
1142 b->dev.class = &pcibus_class; 1142 b->dev.class = &pcibus_class;
1143 b->dev.parent = b->bridge; 1143 b->dev.parent = b->bridge;
1144 sprintf(b->dev.bus_id, "%04x:%02x", pci_domain_nr(b), bus); 1144 dev_set_name(&b->dev, "%04x:%02x", pci_domain_nr(b), bus);
1145 error = device_register(&b->dev); 1145 error = device_register(&b->dev);
1146 if (error) 1146 if (error)
1147 goto class_dev_reg_err; 1147 goto class_dev_reg_err;