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_core.c | |
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_core.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 7f2e775534eb..547bf5d6fcca 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -173,8 +173,7 @@ static int init_slots(struct controller *ctrl) | |||
173 | goto error_name; | 173 | goto error_name; |
174 | } | 174 | } |
175 | 175 | ||
176 | slot->next = ctrl->slot; | 176 | list_add(&slot->slot_list, &ctrl->slot_list); |
177 | ctrl->slot = slot; | ||
178 | } | 177 | } |
179 | 178 | ||
180 | return 0; | 179 | return 0; |
@@ -192,15 +191,14 @@ error: | |||
192 | 191 | ||
193 | static void cleanup_slots(struct controller *ctrl) | 192 | static void cleanup_slots(struct controller *ctrl) |
194 | { | 193 | { |
195 | struct slot *old_slot, *next_slot; | 194 | struct list_head *tmp; |
196 | 195 | struct list_head *next; | |
197 | old_slot = ctrl->slot; | 196 | struct slot *slot; |
198 | ctrl->slot = NULL; | ||
199 | 197 | ||
200 | while (old_slot) { | 198 | list_for_each_safe(tmp, next, &ctrl->slot_list) { |
201 | next_slot = old_slot->next; | 199 | slot = list_entry(tmp, struct slot, slot_list); |
202 | pci_hp_deregister(old_slot->hotplug_slot); | 200 | list_del(&slot->slot_list); |
203 | old_slot = next_slot; | 201 | pci_hp_deregister(slot->hotplug_slot); |
204 | } | 202 | } |
205 | } | 203 | } |
206 | 204 | ||
@@ -391,6 +389,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
391 | goto err_out_none; | 389 | goto err_out_none; |
392 | } | 390 | } |
393 | memset(ctrl, 0, sizeof(struct controller)); | 391 | memset(ctrl, 0, sizeof(struct controller)); |
392 | INIT_LIST_HEAD(&ctrl->slot_list); | ||
394 | 393 | ||
395 | rc = shpc_init(ctrl, pdev); | 394 | rc = shpc_init(ctrl, pdev); |
396 | if (rc) { | 395 | if (rc) { |