diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-02-24 00:25:54 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-02-24 00:25:54 -0800 |
| commit | eac93d606bac4f6ae38d6c071bd5e5bfd06bdfd3 (patch) | |
| tree | 0e4862e6ed774d4b3b179ee025d8d9b77d603924 | |
| parent | a7f43eff84b460c46a72587503180d7bc269be6c (diff) | |
[PATCH] IBM PCI Hotplug: get rid of unneeded ops structure and surrounding logic.
| -rw-r--r-- | drivers/hotplug/ibmphp.h | 5 | ||||
| -rw-r--r-- | drivers/hotplug/ibmphp_core.c | 67 |
2 files changed, 14 insertions, 58 deletions
diff --git a/drivers/hotplug/ibmphp.h b/drivers/hotplug/ibmphp.h index c6c60baed275..6795affd9bdd 100644 --- a/drivers/hotplug/ibmphp.h +++ b/drivers/hotplug/ibmphp.h @@ -683,11 +683,6 @@ extern void ibmphp_hpc_stop_poll_thread (void); #define ENABLE 1 #define DISABLE 0 -#define ADD 0 -#define REMOVE 1 -#define DETAIL 2 - -#define MAX_OPS 3 #define CARD_INFO 0x07 #define PCIX133 0x07 #define PCIX66 0x05 diff --git a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c index 56964f0d9ad5..624b1cc981a5 100644 --- a/drivers/hotplug/ibmphp_core.c +++ b/drivers/hotplug/ibmphp_core.c @@ -55,7 +55,6 @@ MODULE_PARM_DESC (debug, "Debugging mode enabled or not"); MODULE_LICENSE ("GPL"); MODULE_DESCRIPTION (DRIVER_DESC); -static int *ops[MAX_OPS + 1]; struct pci_bus *ibmphp_pci_bus; static int max_slots; @@ -550,20 +549,6 @@ static int __init init_ops (void) struct list_head *tmp; int retval; int rc; - int j; - - for (j = 0; j < MAX_OPS; j++) { - ops[j] = (int *) kmalloc ((max_slots + 1) * sizeof (int), GFP_KERNEL); - memset (ops[j], 0, (max_slots + 1) * sizeof (int)); - if (!ops[j]) { - err ("out of system memory \n"); - return -ENOMEM; - } - } - - ops[ADD][0] = 0; - ops[REMOVE][0] = 0; - ops[DETAIL][0] = 0; list_for_each (tmp, &ibmphp_slot_head) { slot_cur = list_entry (tmp, struct slot, ibm_slot_list); @@ -588,24 +573,15 @@ static int __init init_ops (void) if (retval) return retval; - debug ("status = %x, ext_status = %x\n", slot_cur->status, slot_cur->ext_status); - debug ("SLOT_POWER = %x, SLOT_PRESENT = %x, SLOT_LATCH = %x\n", SLOT_POWER (slot_cur->status), SLOT_PRESENT (slot_cur->status), SLOT_LATCH (slot_cur->status)); + debug ("status = %x\n", slot_cur->status); + debug ("ext_status = %x\n", slot_cur->ext_status); + debug ("SLOT_POWER = %x\n", SLOT_POWER (slot_cur->status)); + debug ("SLOT_PRESENT = %x\n", SLOT_PRESENT (slot_cur->status)); + debug ("SLOT_LATCH = %x\n", SLOT_LATCH (slot_cur->status)); - if (!(SLOT_PWRGD (slot_cur->status)) && (SLOT_PRESENT (slot_cur->status)) && !(SLOT_LATCH (slot_cur->status))) - /* No power, adapter, and latch closed */ - ops[ADD][slot_cur->number] = 1; - else - ops[ADD][slot_cur->number] = 0; - - ops[DETAIL][slot_cur->number] = 1; - - if ((SLOT_PWRGD (slot_cur->status)) && (SLOT_PRESENT (slot_cur->status)) && !(SLOT_LATCH (slot_cur->status))) - /*Power,adapter,latch closed */ - ops[REMOVE][slot_cur->number] = 1; - else - ops[REMOVE][slot_cur->number] = 0; - - if ((SLOT_PWRGD (slot_cur->status)) && !(SLOT_PRESENT (slot_cur->status)) && !(SLOT_LATCH (slot_cur->status))) { + if ((SLOT_PWRGD (slot_cur->status)) && + !(SLOT_PRESENT (slot_cur->status)) && + !(SLOT_LATCH (slot_cur->status))) { debug ("BEFORE POWER OFF COMMAND\n"); rc = power_off (slot_cur); if (rc) @@ -643,35 +619,20 @@ static int validate (struct slot *slot_cur, int opn) if (retval) return retval; - if (!(SLOT_PWRGD (slot_cur->status)) && (SLOT_PRESENT (slot_cur->status)) - && !(SLOT_LATCH (slot_cur->status))) - ops[ADD][number] = 1; - else - ops[ADD][number] = 0; - - ops[DETAIL][number] = 1; - - if ((SLOT_PWRGD (slot_cur->status)) && (SLOT_PRESENT (slot_cur->status)) - && !(SLOT_LATCH (slot_cur->status))) - ops[REMOVE][number] = 1; - else - ops[REMOVE][number] = 0; - switch (opn) { case ENABLE: - if (ops[ADD][number]) + if (!(SLOT_PWRGD (slot_cur->status)) && + (SLOT_PRESENT (slot_cur->status)) && + !(SLOT_LATCH (slot_cur->status))) return 0; break; case DISABLE: - if (ops[REMOVE][number]) - return 0; - break; - case DETAIL: - if (ops[DETAIL][number]) + if ((SLOT_PWRGD (slot_cur->status)) && + (SLOT_PRESENT (slot_cur->status)) && + !(SLOT_LATCH (slot_cur->status))) return 0; break; default: - return -EINVAL; break; } err ("validate failed....\n"); |
