aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/ibmphp_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_core.c')
-rw-r--r--drivers/pci/hotplug/ibmphp_core.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 15302475f5b7..010e46a0c466 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -116,11 +116,9 @@ static inline int slot_update(struct slot **sl)
116static int __init get_max_slots (void) 116static int __init get_max_slots (void)
117{ 117{
118 struct slot *slot_cur; 118 struct slot *slot_cur;
119 struct list_head *tmp;
120 u8 slot_count = 0; 119 u8 slot_count = 0;
121 120
122 list_for_each(tmp, &ibmphp_slot_head) { 121 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
123 slot_cur = list_entry(tmp, struct slot, ibm_slot_list);
124 /* sometimes the hot-pluggable slots start with 4 (not always from 1) */ 122 /* sometimes the hot-pluggable slots start with 4 (not always from 1) */
125 slot_count = max(slot_count, slot_cur->number); 123 slot_count = max(slot_count, slot_cur->number);
126 } 124 }
@@ -501,13 +499,10 @@ static int get_bus_name(struct hotplug_slot *hotplug_slot, char *value)
501static int __init init_ops(void) 499static int __init init_ops(void)
502{ 500{
503 struct slot *slot_cur; 501 struct slot *slot_cur;
504 struct list_head *tmp;
505 int retval; 502 int retval;
506 int rc; 503 int rc;
507 504
508 list_for_each(tmp, &ibmphp_slot_head) { 505 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
509 slot_cur = list_entry(tmp, struct slot, ibm_slot_list);
510
511 if (!slot_cur) 506 if (!slot_cur)
512 return -ENODEV; 507 return -ENODEV;
513 508
@@ -669,9 +664,7 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function)
669{ 664{
670 struct pci_func *func_cur; 665 struct pci_func *func_cur;
671 struct slot *slot_cur; 666 struct slot *slot_cur;
672 struct list_head *tmp; 667 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
673 list_for_each(tmp, &ibmphp_slot_head) {
674 slot_cur = list_entry(tmp, struct slot, ibm_slot_list);
675 if (slot_cur->func) { 668 if (slot_cur->func) {
676 func_cur = slot_cur->func; 669 func_cur = slot_cur->func;
677 while (func_cur) { 670 while (func_cur) {
@@ -693,14 +686,12 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function)
693 *************************************************************/ 686 *************************************************************/
694static void free_slots(void) 687static void free_slots(void)
695{ 688{
696 struct slot *slot_cur; 689 struct slot *slot_cur, *next;
697 struct list_head *tmp;
698 struct list_head *next;
699 690
700 debug("%s -- enter\n", __func__); 691 debug("%s -- enter\n", __func__);
701 692
702 list_for_each_safe(tmp, next, &ibmphp_slot_head) { 693 list_for_each_entry_safe(slot_cur, next, &ibmphp_slot_head,
703 slot_cur = list_entry(tmp, struct slot, ibm_slot_list); 694 ibm_slot_list) {
704 pci_hp_deregister(slot_cur->hotplug_slot); 695 pci_hp_deregister(slot_cur->hotplug_slot);
705 } 696 }
706 debug("%s -- exit\n", __func__); 697 debug("%s -- exit\n", __func__);