]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/ibmphp_core.c
Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
[linux-2.6] / drivers / pci / hotplug / ibmphp_core.c
index e13d5b87241a870c3eba6c150fb6f4b291d0753a..87b6b8b280e65024fe112e06f1fe59e75a297aeb 100644 (file)
@@ -34,9 +34,8 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/wait.h>
-#include <linux/smp_lock.h>
 #include "../pci.h"
-#include "../../../arch/i386/pci/pci.h"        /* for struct irq_routing_table */
+#include "../../../arch/x86/pci/pci.h" /* for struct irq_routing_table */
 #include "ibmphp.h"
 
 #define attn_on(sl)  ibmphp_hpc_writeslot (sl, HPC_SLOT_ATTNON)
@@ -285,7 +284,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
                                        (ulong) hotplug_slot, (ulong) value);
         
        ibmphp_lock_operations();
-       if (hotplug_slot && value) {
+       if (hotplug_slot) {
                pslot = hotplug_slot->private;
                if (pslot) {
                        memcpy(&myslot, pslot, sizeof(struct slot));
@@ -315,7 +314,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value)
        debug("get_latch_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
                                        (ulong) hotplug_slot, (ulong) value);
        ibmphp_lock_operations();
-       if (hotplug_slot && value) {
+       if (hotplug_slot) {
                pslot = hotplug_slot->private;
                if (pslot) {
                        memcpy(&myslot, pslot, sizeof(struct slot));
@@ -342,7 +341,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
        debug("get_power_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
                                        (ulong) hotplug_slot, (ulong) value);
        ibmphp_lock_operations();
-       if (hotplug_slot && value) {
+       if (hotplug_slot) {
                pslot = hotplug_slot->private;
                if (pslot) {
                        memcpy(&myslot, pslot, sizeof(struct slot));
@@ -369,7 +368,7 @@ static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 * value)
        debug("get_adapter_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
                                        (ulong) hotplug_slot, (ulong) value);
        ibmphp_lock_operations();
-       if (hotplug_slot && value) {
+       if (hotplug_slot) {
                pslot = hotplug_slot->private;
                if (pslot) {
                        memcpy(&myslot, pslot, sizeof(struct slot));
@@ -401,7 +400,7 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
 
        ibmphp_lock_operations();
 
-       if (hotplug_slot && value) {
+       if (hotplug_slot) {
                pslot = hotplug_slot->private;
                if (pslot) {
                        rc = 0;
@@ -441,7 +440,7 @@ static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
 
        ibmphp_lock_operations();
 
-       if (hotplug_slot && value) {
+       if (hotplug_slot) {
                pslot = hotplug_slot->private;
                if (pslot) {
                        rc = get_cur_bus_info(&pslot);
@@ -762,10 +761,13 @@ static void ibm_unconfigure_device(struct pci_func *func)
        debug("func->device << 3 | 0x0  = %x\n", func->device << 3 | 0x0);
 
        for (j = 0; j < 0x08; j++) {
-               temp = pci_find_slot(func->busno, (func->device << 3) | j);
-               if (temp)
+               temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j);
+               if (temp) {
                        pci_remove_bus_device(temp);
+                       pci_dev_put(temp);
+               }
        }
+       pci_dev_put(func->dev);
 }
 
 /*
@@ -824,7 +826,7 @@ static int ibm_configure_device(struct pci_func *func)
        if (!(bus_structure_fixup(func->busno)))
                flag = 1;
        if (func->dev == NULL)
-               func->dev = pci_find_slot(func->busno,
+               func->dev = pci_get_bus_and_slot(func->busno,
                                PCI_DEVFN(func->device, func->function));
 
        if (func->dev == NULL) {
@@ -837,7 +839,7 @@ static int ibm_configure_device(struct pci_func *func)
                if (num)
                        pci_bus_add_devices(bus);
 
-               func->dev = pci_find_slot(func->busno,
+               func->dev = pci_get_bus_and_slot(func->busno,
                                PCI_DEVFN(func->device, func->function));
                if (func->dev == NULL) {
                        err("ERROR... : pci_dev still NULL\n");