diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-12-21 20:01:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-07 18:50:04 -0500 |
commit | 2410fa4eaec4133f9fa8968f277ddb28b89b92b3 (patch) | |
tree | d005980c5adbab8c612c2bf8c95a362b7375e7b6 /drivers/pci/hotplug/pciehp.h | |
parent | a0b1725720d9a023a1dee129234f5972056038c6 (diff) |
pciehp: cleanup slot list
This patch cleans up slot list handling (use list_head). This has no
functional change.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/pciehp.h')
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 6a2f427768ca..d07ac45f1272 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -52,7 +52,6 @@ extern int pciehp_force; | |||
52 | 52 | ||
53 | #define SLOT_NAME_SIZE 10 | 53 | #define SLOT_NAME_SIZE 10 |
54 | struct slot { | 54 | struct slot { |
55 | struct slot *next; | ||
56 | u8 bus; | 55 | u8 bus; |
57 | u8 device; | 56 | u8 device; |
58 | u32 number; | 57 | u32 number; |
@@ -99,6 +98,7 @@ struct controller { | |||
99 | int slot_num_inc; /* 1 or -1 */ | 98 | int slot_num_inc; /* 1 or -1 */ |
100 | struct pci_dev *pci_dev; | 99 | struct pci_dev *pci_dev; |
101 | struct pci_bus *pci_bus; | 100 | struct pci_bus *pci_bus; |
101 | struct list_head slot_list; | ||
102 | struct event_info event_queue[MAX_EVENTS]; | 102 | struct event_info event_queue[MAX_EVENTS]; |
103 | struct slot *slot; | 103 | struct slot *slot; |
104 | struct hpc_ops *hpc_ops; | 104 | struct hpc_ops *hpc_ops; |
@@ -198,20 +198,15 @@ extern struct controller *pciehp_ctrl_list; | |||
198 | 198 | ||
199 | static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device) | 199 | static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device) |
200 | { | 200 | { |
201 | struct slot *p_slot, *tmp_slot = NULL; | 201 | struct slot *slot; |
202 | |||
203 | p_slot = ctrl->slot; | ||
204 | 202 | ||
205 | while (p_slot && (p_slot->device != device)) { | 203 | list_for_each_entry(slot, &ctrl->slot_list, slot_list) { |
206 | tmp_slot = p_slot; | 204 | if (slot->device == device) |
207 | p_slot = p_slot->next; | 205 | return slot; |
208 | } | ||
209 | if (p_slot == NULL) { | ||
210 | err("ERROR: pciehp_find_slot device=0x%x\n", device); | ||
211 | p_slot = tmp_slot; | ||
212 | } | 206 | } |
213 | 207 | ||
214 | return p_slot; | 208 | err("%s: slot (device=0x%x) not found\n", __FUNCTION__, device); |
209 | return NULL; | ||
215 | } | 210 | } |
216 | 211 | ||
217 | static inline int wait_for_ctrl_irq(struct controller *ctrl) | 212 | static inline int wait_for_ctrl_irq(struct controller *ctrl) |