aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_pci.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2009-09-15 04:26:56 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-17 13:05:51 -0400
commitd689f7eb364a51ccd857605dede0d6c22a1aad91 (patch)
tree34efda76db5ec3e0c57034deb254014c55b93068 /drivers/pci/hotplug/pciehp_pci.c
parentab9c6c86701b498445334db746aa2e8dc473c7b6 (diff)
PCI: pciehp: remove device field
The device field in the struct slot is not necessary because it is always 0 in pciehp driver. Acked-by: Alex Chiang <achiang@hp.com> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_pci.c')
-rw-r--r--drivers/pci/hotplug/pciehp_pci.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index 2e5f6b816da6..0efffd45ccbf 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -67,24 +67,23 @@ int pciehp_configure_device(struct slot *p_slot)
67 int num, fn; 67 int num, fn;
68 struct controller *ctrl = p_slot->ctrl; 68 struct controller *ctrl = p_slot->ctrl;
69 69
70 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); 70 dev = pci_get_slot(parent, PCI_DEVFN(0, 0));
71 if (dev) { 71 if (dev) {
72 ctrl_err(ctrl, "Device %s already exists " 72 ctrl_err(ctrl, "Device %s already exists "
73 "at %04x:%02x:%02x, cannot hot-add\n", pci_name(dev), 73 "at %04x:%02x:00, cannot hot-add\n", pci_name(dev),
74 pci_domain_nr(parent), parent->number, 74 pci_domain_nr(parent), parent->number);
75 p_slot->device);
76 pci_dev_put(dev); 75 pci_dev_put(dev);
77 return -EINVAL; 76 return -EINVAL;
78 } 77 }
79 78
80 num = pci_scan_slot(parent, PCI_DEVFN(p_slot->device, 0)); 79 num = pci_scan_slot(parent, PCI_DEVFN(0, 0));
81 if (num == 0) { 80 if (num == 0) {
82 ctrl_err(ctrl, "No new device found\n"); 81 ctrl_err(ctrl, "No new device found\n");
83 return -ENODEV; 82 return -ENODEV;
84 } 83 }
85 84
86 for (fn = 0; fn < 8; fn++) { 85 for (fn = 0; fn < 8; fn++) {
87 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, fn)); 86 dev = pci_get_slot(parent, PCI_DEVFN(0, fn));
88 if (!dev) 87 if (!dev)
89 continue; 88 continue;
90 if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) { 89 if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
@@ -116,16 +115,14 @@ int pciehp_unconfigure_device(struct slot *p_slot)
116 u16 command; 115 u16 command;
117 struct controller *ctrl = p_slot->ctrl; 116 struct controller *ctrl = p_slot->ctrl;
118 117
119 ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:%02x\n", 118 ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:00\n",
120 __func__, pci_domain_nr(parent), parent->number, 119 __func__, pci_domain_nr(parent), parent->number);
121 p_slot->device);
122 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &presence); 120 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &presence);
123 if (ret) 121 if (ret)
124 presence = 0; 122 presence = 0;
125 123
126 for (j = 0; j < 8; j++) { 124 for (j = 0; j < 8; j++) {
127 struct pci_dev* temp = pci_get_slot(parent, 125 struct pci_dev* temp = pci_get_slot(parent, PCI_DEVFN(0, j));
128 (p_slot->device << 3) | j);
129 if (!temp) 126 if (!temp)
130 continue; 127 continue;
131 if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { 128 if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) {