aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 16:13:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 16:13:55 -0500
commitcff2f741b8ee8a70b208830e330de053efd4fc45 (patch)
tree83367ed74d889e2c8179f1f8b5d6f6f73b857982 /drivers/pci/pci-driver.c
parentb0885d01f9ab1274109c02942c881d598f939623 (diff)
parent92e9e6d1f9844b73a26215025a922e7d7aeae361 (diff)
Merge tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg Kroah-Hartman: "Here's the large driver core updates for 3.8-rc1. The biggest thing here is the various __dev* marking removals. This is going to be a pain for the merge with different subsystem trees, I know, but all of the patches included here have been ACKed by their various subsystem maintainers, as they wanted them to go through here. If this is too much of a pain, I can pull all of them out of this tree and just send you one with the other fixes/updates and then, after 3.8-rc1 is out, do the rest of the removals to ensure we catch them all, it's up to you. The merges should all be trivial, and Stephen has been doing them all in linux-next for a few weeks now quite easily. Other than the __dev* marking removals, there's nothing major here, some firmware loading updates and other minor things in the driver core. All of these have (much to Stephen's annoyance), been in linux-next for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio update. * tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits) modpost.c: Stop checking __dev* section mismatches init.h: Remove __dev* sections from the kernel acpi: remove use of __devinit PCI: Remove __dev* markings PCI: Always build setup-bus when PCI is enabled PCI: Move pci_uevent into pci-driver.c PCI: Remove CONFIG_HOTPLUG ifdefs unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs sh/PCI: Remove CONFIG_HOTPLUG ifdefs powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs mips/PCI: Remove CONFIG_HOTPLUG ifdefs microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs dma: remove use of __devinit dma: remove use of __devexit_p firewire: remove use of __devinitdata firewire: remove use of __devinit leds: remove use of __devexit leds: remove use of __devinit leds: remove use of __devexit_p mmc: remove use of __devexit ...
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 6c94fc9489e7..1dc78c5cabf8 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -89,10 +89,6 @@ static void pci_free_dynids(struct pci_driver *drv)
89 spin_unlock(&drv->dynids.lock); 89 spin_unlock(&drv->dynids.lock);
90} 90}
91 91
92/*
93 * Dynamic device ID manipulation via sysfs is disabled for !CONFIG_HOTPLUG
94 */
95#ifdef CONFIG_HOTPLUG
96/** 92/**
97 * store_new_id - sysfs frontend to pci_add_dynid() 93 * store_new_id - sysfs frontend to pci_add_dynid()
98 * @driver: target device driver 94 * @driver: target device driver
@@ -191,10 +187,6 @@ static struct driver_attribute pci_drv_attrs[] = {
191 __ATTR_NULL, 187 __ATTR_NULL,
192}; 188};
193 189
194#else
195#define pci_drv_attrs NULL
196#endif /* CONFIG_HOTPLUG */
197
198/** 190/**
199 * pci_match_id - See if a pci device matches a given pci_id table 191 * pci_match_id - See if a pci device matches a given pci_id table
200 * @ids: array of PCI device id structures to search in 192 * @ids: array of PCI device id structures to search in
@@ -1223,12 +1215,38 @@ void pci_dev_put(struct pci_dev *dev)
1223 put_device(&dev->dev); 1215 put_device(&dev->dev);
1224} 1216}
1225 1217
1226#ifndef CONFIG_HOTPLUG 1218static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
1227int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
1228{ 1219{
1229 return -ENODEV; 1220 struct pci_dev *pdev;
1221
1222 if (!dev)
1223 return -ENODEV;
1224
1225 pdev = to_pci_dev(dev);
1226 if (!pdev)
1227 return -ENODEV;
1228
1229 if (add_uevent_var(env, "PCI_CLASS=%04X", pdev->class))
1230 return -ENOMEM;
1231
1232 if (add_uevent_var(env, "PCI_ID=%04X:%04X", pdev->vendor, pdev->device))
1233 return -ENOMEM;
1234
1235 if (add_uevent_var(env, "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor,
1236 pdev->subsystem_device))
1237 return -ENOMEM;
1238
1239 if (add_uevent_var(env, "PCI_SLOT_NAME=%s", pci_name(pdev)))
1240 return -ENOMEM;
1241
1242 if (add_uevent_var(env, "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x",
1243 pdev->vendor, pdev->device,
1244 pdev->subsystem_vendor, pdev->subsystem_device,
1245 (u8)(pdev->class >> 16), (u8)(pdev->class >> 8),
1246 (u8)(pdev->class)))
1247 return -ENOMEM;
1248 return 0;
1230} 1249}
1231#endif
1232 1250
1233struct bus_type pci_bus_type = { 1251struct bus_type pci_bus_type = {
1234 .name = "pci", 1252 .name = "pci",