aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug.c28
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c60
-rw-r--r--drivers/pci/hotplug/rpadlpar_sysfs.c6
-rw-r--r--drivers/pci/pci-driver.c3
-rw-r--r--drivers/pci/pci.h3
-rw-r--r--drivers/pci/setup-irq.c2
6 files changed, 12 insertions, 90 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
6int pci_uevent(struct device *dev, char **envp, int num_envp, 6int 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/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index bd433ef6bfc6..f0eba534f805 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -694,66 +694,6 @@ int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot,
694 if ((slot == NULL) || (info == NULL)) 694 if ((slot == NULL) || (info == NULL))
695 return -ENODEV; 695 return -ENODEV;
696 696
697 /*
698 * check all fields in the info structure, and update timestamps
699 * for the files referring to the fields that have now changed.
700 */
701 if ((has_power_file(slot) == 0) &&
702 (slot->info->power_status != info->power_status)) {
703 retval = sysfs_update_file(&slot->kobj,
704 &hotplug_slot_attr_power.attr);
705 if (retval)
706 return retval;
707 }
708
709 if ((has_attention_file(slot) == 0) &&
710 (slot->info->attention_status != info->attention_status)) {
711 retval = sysfs_update_file(&slot->kobj,
712 &hotplug_slot_attr_attention.attr);
713 if (retval)
714 return retval;
715 }
716
717 if ((has_latch_file(slot) == 0) &&
718 (slot->info->latch_status != info->latch_status)) {
719 retval = sysfs_update_file(&slot->kobj,
720 &hotplug_slot_attr_latch.attr);
721 if (retval)
722 return retval;
723 }
724
725 if ((has_adapter_file(slot) == 0) &&
726 (slot->info->adapter_status != info->adapter_status)) {
727 retval = sysfs_update_file(&slot->kobj,
728 &hotplug_slot_attr_presence.attr);
729 if (retval)
730 return retval;
731 }
732
733 if ((has_address_file(slot) == 0) &&
734 (slot->info->address != info->address)) {
735 retval = sysfs_update_file(&slot->kobj,
736 &hotplug_slot_attr_address.attr);
737 if (retval)
738 return retval;
739 }
740
741 if ((has_max_bus_speed_file(slot) == 0) &&
742 (slot->info->max_bus_speed != info->max_bus_speed)) {
743 retval = sysfs_update_file(&slot->kobj,
744 &hotplug_slot_attr_max_bus_speed.attr);
745 if (retval)
746 return retval;
747 }
748
749 if ((has_cur_bus_speed_file(slot) == 0) &&
750 (slot->info->cur_bus_speed != info->cur_bus_speed)) {
751 retval = sysfs_update_file(&slot->kobj,
752 &hotplug_slot_attr_cur_bus_speed.attr);
753 if (retval)
754 return retval;
755 }
756
757 memcpy (slot->info, info, sizeof (struct hotplug_slot_info)); 697 memcpy (slot->info, info, sizeof (struct hotplug_slot_info));
758 698
759 return 0; 699 return 0;
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c
index df076064a3e0..a080fedf0332 100644
--- a/drivers/pci/hotplug/rpadlpar_sysfs.c
+++ b/drivers/pci/hotplug/rpadlpar_sysfs.c
@@ -129,17 +129,17 @@ struct kobj_type ktype_dlpar_io = {
129}; 129};
130 130
131struct kset dlpar_io_kset = { 131struct kset dlpar_io_kset = {
132 .kobj = {.name = DLPAR_KOBJ_NAME, 132 .kobj = {.ktype = &ktype_dlpar_io,
133 .ktype = &ktype_dlpar_io,
134 .parent = &pci_hotplug_slots_subsys.kobj}, 133 .parent = &pci_hotplug_slots_subsys.kobj},
135 .ktype = &ktype_dlpar_io, 134 .ktype = &ktype_dlpar_io,
136}; 135};
137 136
138int dlpar_sysfs_init(void) 137int dlpar_sysfs_init(void)
139{ 138{
139 kobject_set_name(&dlpar_io_kset.kobj, DLPAR_KOBJ_NAME);
140 if (kset_register(&dlpar_io_kset)) { 140 if (kset_register(&dlpar_io_kset)) {
141 printk(KERN_ERR "rpadlpar_io: cannot register kset for %s\n", 141 printk(KERN_ERR "rpadlpar_io: cannot register kset for %s\n",
142 dlpar_io_kset.kobj.name); 142 kobject_name(&dlpar_io_kset.kobj));
143 return -EINVAL; 143 return -EINVAL;
144 } 144 }
145 145
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
535int pci_uevent(struct device *dev, char **envp, int num_envp, 535int 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
3extern int pci_uevent(struct device *dev, char **envp, int num_envp, 3extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
4 char *buffer, int buffer_size);
5extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); 4extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
6extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); 5extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
7extern void pci_cleanup_rom(struct pci_dev *dev); 6extern void pci_cleanup_rom(struct pci_dev *dev);
diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
index 568f1877315c..05ca2ed9eb51 100644
--- a/drivers/pci/setup-irq.c
+++ b/drivers/pci/setup-irq.c
@@ -48,7 +48,7 @@ pdev_fixup_irq(struct pci_dev *dev,
48 dev->irq = irq; 48 dev->irq = irq;
49 49
50 pr_debug("PCI: fixup irq: (%s) got %d\n", 50 pr_debug("PCI: fixup irq: (%s) got %d\n",
51 dev->dev.kobj.name, dev->irq); 51 kobject_name(&dev->dev.kobj), dev->irq);
52 52
53 /* Always tell the device, so the driver knows what is 53 /* Always tell the device, so the driver knows what is
54 the real IRQ to use; the device does not use it. */ 54 the real IRQ to use; the device does not use it. */