diff options
author | rajesh.shah@intel.com <rajesh.shah@intel.com> | 2005-10-13 15:05:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 18:37:00 -0400 |
commit | 2178bfad9ccb0cbeb79599dd1dc349dd4567aa49 (patch) | |
tree | 9a58ee4a73e36b31edd8b5660966403d7c6c5562 /drivers/pci/hotplug/shpchp_pci.c | |
parent | 70b6091946ab486c4dab8abeb4a3fc2bf7d3e7fe (diff) |
[PATCH] shpchp: remove redundant data structures
State information is currently stored in per-slot as well as
per-pci-function data structures in shpchp. There's a lot of
overlap in the information kept, and some of it is never used.
This patch consolidates the state information to per-slot and
eliminates unused data structures. The biggest change is to
eliminate the pci_func structure and the code around managing
its lists.
Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_pci.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_pci.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c index f51a97d7611f..8f0a1667f2e6 100644 --- a/drivers/pci/hotplug/shpchp_pci.c +++ b/drivers/pci/hotplug/shpchp_pci.c | |||
@@ -148,20 +148,33 @@ int shpchp_configure_device(struct slot *p_slot) | |||
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
150 | 150 | ||
151 | int shpchp_unconfigure_device(struct pci_func* func) | 151 | int shpchp_unconfigure_device(struct slot *p_slot) |
152 | { | 152 | { |
153 | int rc = 0; | 153 | int rc = 0; |
154 | int j; | 154 | int j; |
155 | u8 bctl = 0; | ||
155 | 156 | ||
156 | dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, | 157 | dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, p_slot->device); |
157 | func->device, func->function); | ||
158 | 158 | ||
159 | for (j=0; j<8 ; j++) { | 159 | for (j=0; j<8 ; j++) { |
160 | struct pci_dev* temp = pci_find_slot(func->bus, | 160 | struct pci_dev* temp = pci_find_slot(p_slot->bus, |
161 | (func->device << 3) | j); | 161 | (p_slot->device << 3) | j); |
162 | if (temp) { | 162 | if (!temp) |
163 | pci_remove_bus_device(temp); | 163 | continue; |
164 | if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { | ||
165 | err("Cannot remove display device %s\n", | ||
166 | pci_name(temp)); | ||
167 | continue; | ||
168 | } | ||
169 | if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | ||
170 | pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl); | ||
171 | if (bctl & PCI_BRIDGE_CTL_VGA) { | ||
172 | err("Cannot remove display device %s\n", | ||
173 | pci_name(temp)); | ||
174 | continue; | ||
175 | } | ||
164 | } | 176 | } |
177 | pci_remove_bus_device(temp); | ||
165 | } | 178 | } |
166 | return rc; | 179 | return rc; |
167 | } | 180 | } |