diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-01-25 19:57:40 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:11 -0500 |
commit | 5b1a960d180e9660a87b0c661a754efabc1b1d3a (patch) | |
tree | f49931b000ff784c3267f134ff3734f640fcd5d7 /drivers/pci/hotplug/shpchp.h | |
parent | dfcd5f68ec916414532e88583d1557b6ac0197f5 (diff) |
[PATCH] shpchp - cleanup slot list
This patch changes SHPCHP driver to use list_head structure for
managing slot list.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp.h')
-rw-r--r-- | drivers/pci/hotplug/shpchp.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index e03ee0826700..c0be7a1c3ff7 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -56,7 +56,6 @@ extern int shpchp_debug; | |||
56 | #define SLOT_MAGIC 0x67267321 | 56 | #define SLOT_MAGIC 0x67267321 |
57 | struct slot { | 57 | struct slot { |
58 | u32 magic; | 58 | u32 magic; |
59 | struct slot *next; | ||
60 | u8 bus; | 59 | u8 bus; |
61 | u8 device; | 60 | u8 device; |
62 | u16 status; | 61 | u16 status; |
@@ -87,7 +86,7 @@ struct controller { | |||
87 | struct pci_dev *pci_dev; | 86 | struct pci_dev *pci_dev; |
88 | struct pci_bus *pci_bus; | 87 | struct pci_bus *pci_bus; |
89 | struct event_info event_queue[10]; | 88 | struct event_info event_queue[10]; |
90 | struct slot *slot; | 89 | struct list_head slot_list; |
91 | struct hpc_ops *hpc_ops; | 90 | struct hpc_ops *hpc_ops; |
92 | wait_queue_head_t queue; /* sleep & wake process */ | 91 | wait_queue_head_t queue; /* sleep & wake process */ |
93 | u8 next_event; | 92 | u8 next_event; |
@@ -315,23 +314,19 @@ static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const ch | |||
315 | 314 | ||
316 | static inline struct slot *shpchp_find_slot (struct controller *ctrl, u8 device) | 315 | static inline struct slot *shpchp_find_slot (struct controller *ctrl, u8 device) |
317 | { | 316 | { |
318 | struct slot *p_slot, *tmp_slot = NULL; | 317 | struct slot *slot; |
319 | 318 | ||
320 | if (!ctrl) | 319 | if (!ctrl) |
321 | return NULL; | 320 | return NULL; |
322 | 321 | ||
323 | p_slot = ctrl->slot; | 322 | list_for_each_entry(slot, &ctrl->slot_list, slot_list) { |
324 | 323 | if (slot->device == device) | |
325 | while (p_slot && (p_slot->device != device)) { | 324 | return slot; |
326 | tmp_slot = p_slot; | ||
327 | p_slot = p_slot->next; | ||
328 | } | ||
329 | if (p_slot == NULL) { | ||
330 | err("ERROR: shpchp_find_slot device=0x%x\n", device); | ||
331 | p_slot = tmp_slot; | ||
332 | } | 325 | } |
333 | 326 | ||
334 | return (p_slot); | 327 | err("%s: slot (device=0x%x) not found\n", __FUNCTION__, device); |
328 | |||
329 | return NULL; | ||
335 | } | 330 | } |
336 | 331 | ||
337 | static inline int wait_for_ctrl_irq (struct controller *ctrl) | 332 | static inline int wait_for_ctrl_irq (struct controller *ctrl) |