diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug.c | 28 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 3 | ||||
-rw-r--r-- | drivers/pci/pci.h | 3 |
3 files changed, 8 insertions, 26 deletions
diff --git a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c index 1c97e7dd130b..2b5352a7dffc 100644 --- a/drivers/pci/hotplug.c +++ b/drivers/pci/hotplug.c | |||
@@ -3,12 +3,9 @@ | |||
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include "pci.h" | 4 | #include "pci.h" |
5 | 5 | ||
6 | int pci_uevent(struct device *dev, char **envp, int num_envp, | 6 | int pci_uevent(struct device *dev, struct kobj_uevent_env *env) |
7 | char *buffer, int buffer_size) | ||
8 | { | 7 | { |
9 | struct pci_dev *pdev; | 8 | struct pci_dev *pdev; |
10 | int i = 0; | ||
11 | int length = 0; | ||
12 | 9 | ||
13 | if (!dev) | 10 | if (!dev) |
14 | return -ENODEV; | 11 | return -ENODEV; |
@@ -17,37 +14,24 @@ int pci_uevent(struct device *dev, char **envp, int num_envp, | |||
17 | if (!pdev) | 14 | if (!pdev) |
18 | return -ENODEV; | 15 | return -ENODEV; |
19 | 16 | ||
20 | if (add_uevent_var(envp, num_envp, &i, | 17 | if (add_uevent_var(env, "PCI_CLASS=%04X", pdev->class)) |
21 | buffer, buffer_size, &length, | ||
22 | "PCI_CLASS=%04X", pdev->class)) | ||
23 | return -ENOMEM; | 18 | return -ENOMEM; |
24 | 19 | ||
25 | if (add_uevent_var(envp, num_envp, &i, | 20 | if (add_uevent_var(env, "PCI_ID=%04X:%04X", pdev->vendor, pdev->device)) |
26 | buffer, buffer_size, &length, | ||
27 | "PCI_ID=%04X:%04X", pdev->vendor, pdev->device)) | ||
28 | return -ENOMEM; | 21 | return -ENOMEM; |
29 | 22 | ||
30 | if (add_uevent_var(envp, num_envp, &i, | 23 | if (add_uevent_var(env, "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor, |
31 | buffer, buffer_size, &length, | ||
32 | "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor, | ||
33 | pdev->subsystem_device)) | 24 | pdev->subsystem_device)) |
34 | return -ENOMEM; | 25 | return -ENOMEM; |
35 | 26 | ||
36 | if (add_uevent_var(envp, num_envp, &i, | 27 | if (add_uevent_var(env, "PCI_SLOT_NAME=%s", pci_name(pdev))) |
37 | buffer, buffer_size, &length, | ||
38 | "PCI_SLOT_NAME=%s", pci_name(pdev))) | ||
39 | return -ENOMEM; | 28 | return -ENOMEM; |
40 | 29 | ||
41 | if (add_uevent_var(envp, num_envp, &i, | 30 | if (add_uevent_var(env, "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x", |
42 | buffer, buffer_size, &length, | ||
43 | "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x", | ||
44 | pdev->vendor, pdev->device, | 31 | pdev->vendor, pdev->device, |
45 | pdev->subsystem_vendor, pdev->subsystem_device, | 32 | pdev->subsystem_vendor, pdev->subsystem_device, |
46 | (u8)(pdev->class >> 16), (u8)(pdev->class >> 8), | 33 | (u8)(pdev->class >> 16), (u8)(pdev->class >> 8), |
47 | (u8)(pdev->class))) | 34 | (u8)(pdev->class))) |
48 | return -ENOMEM; | 35 | return -ENOMEM; |
49 | |||
50 | envp[i] = NULL; | ||
51 | |||
52 | return 0; | 36 | return 0; |
53 | } | 37 | } |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 004bc2487270..f61be3abfdca 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -532,8 +532,7 @@ void pci_dev_put(struct pci_dev *dev) | |||
532 | } | 532 | } |
533 | 533 | ||
534 | #ifndef CONFIG_HOTPLUG | 534 | #ifndef CONFIG_HOTPLUG |
535 | int pci_uevent(struct device *dev, char **envp, int num_envp, | 535 | int pci_uevent(struct device *dev, struct kobj_uevent_env *env) |
536 | char *buffer, int buffer_size) | ||
537 | { | 536 | { |
538 | return -ENODEV; | 537 | return -ENODEV; |
539 | } | 538 | } |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 4c36e80f6d26..b3a7d5b0f936 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -1,7 +1,6 @@ | |||
1 | /* Functions internal to the PCI core code */ | 1 | /* Functions internal to the PCI core code */ |
2 | 2 | ||
3 | extern int pci_uevent(struct device *dev, char **envp, int num_envp, | 3 | extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env); |
4 | char *buffer, int buffer_size); | ||
5 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); | 4 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); |
6 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); | 5 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); |
7 | extern void pci_cleanup_rom(struct pci_dev *dev); | 6 | extern void pci_cleanup_rom(struct pci_dev *dev); |