]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/cpqphp_core.c
PCI: introduce pci_slot
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / cpqphp_core.c
index 74178875b9494920801c3a378a8b5bb344c5d0e4..54defec51d0895f7dd2136230fa56e87e8feac3b 100644 (file)
@@ -315,7 +315,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
 {
        struct slot *slot = hotplug_slot->private;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        kfree(slot->hotplug_slot->info);
        kfree(slot->hotplug_slot->name);
@@ -338,7 +338,7 @@ static int ctrl_slot_setup(struct controller *ctrl,
        void __iomem *slot_entry= NULL;
        int result = -ENOMEM;
 
-       dbg("%s\n", __FUNCTION__);
+       dbg("%s\n", __func__);
 
        tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR);
 
@@ -434,7 +434,9 @@ static int ctrl_slot_setup(struct controller *ctrl,
                                slot->bus, slot->device,
                                slot->number, ctrl->slot_device_offset,
                                slot_number);
-               result = pci_hp_register(hotplug_slot);
+               result = pci_hp_register(hotplug_slot,
+                                        ctrl->pci_dev->subordinate,
+                                        slot->device);
                if (result) {
                        err("pci_hp_register failed with error %d\n", result);
                        goto error_name;
@@ -513,7 +515,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot)
 
        u8 tbus, tdevice, tslot, bridgeSlot;
 
-       dbg("%s: %p, %d, %d, %p\n", __FUNCTION__, bus, bus_num, dev_num, slot);
+       dbg("%s: %p, %d, %d, %p\n", __func__, bus, bus_num, dev_num, slot);
 
        bridgeSlot = 0xFF;
 
@@ -636,7 +638,7 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
        u8 device;
        u8 function;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
                return -ENODEV;
@@ -663,7 +665,7 @@ static int process_SI(struct hotplug_slot *hotplug_slot)
        u8 device;
        u8 function;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
                return -ENODEV;
@@ -695,7 +697,7 @@ static int process_SS(struct hotplug_slot *hotplug_slot)
        u8 device;
        u8 function;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
                return -ENODEV;
@@ -708,7 +710,7 @@ static int process_SS(struct hotplug_slot *hotplug_slot)
        if (!slot_func)
                return -ENODEV;
 
-       dbg("In %s, slot_func = %p, ctrl = %p\n", __FUNCTION__, slot_func, ctrl);
+       dbg("In %s, slot_func = %p, ctrl = %p\n", __func__, slot_func, ctrl);
        return cpqhp_process_SS(ctrl, slot_func);
 }
 
@@ -718,7 +720,7 @@ static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value)
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        return cpqhp_hardware_test(ctrl, value);        
 }
@@ -729,7 +731,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        *value = get_slot_enabled(ctrl, slot);
        return 0;
@@ -740,7 +742,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
        
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        *value = cpq_get_attention_status(ctrl, slot);
        return 0;
@@ -751,7 +753,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        *value = cpq_get_latch_status(ctrl, slot);
 
@@ -763,7 +765,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        *value = get_presence_status(ctrl, slot);
 
@@ -775,7 +777,7 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        *value = ctrl->speed_capability;
 
@@ -787,7 +789,7 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
        struct slot *slot = hotplug_slot->private;
        struct controller *ctrl = slot->ctrl;
 
-       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+       dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
        *value = ctrl->speed;
 
@@ -841,7 +843,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                // TODO: This code can be made to support non-Compaq or Intel subsystem IDs
                rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid);
                if (rc) {
-                       err("%s : pci_read_config_word failed\n", __FUNCTION__);
+                       err("%s : pci_read_config_word failed\n", __func__);
                        goto err_disable_device;
                }
                dbg("Subsystem Vendor ID: %x\n", subsystem_vid);
@@ -853,14 +855,14 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
                ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL);
                if (!ctrl) {
-                       err("%s : out of memory\n", __FUNCTION__);
+                       err("%s : out of memory\n", __func__);
                        rc = -ENOMEM;
                        goto err_disable_device;
                }
 
                rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subsystem_deviceid);
                if (rc) {
-                       err("%s : pci_read_config_word failed\n", __FUNCTION__);
+                       err("%s : pci_read_config_word failed\n", __func__);
                        goto err_free_ctrl;
                }
 
@@ -1142,7 +1144,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK));
        if (rc) {
                err("%s: unable to save PCI configuration data, error %d\n",
-                               __FUNCTION__, rc);
+                               __func__, rc);
                goto err_iounmap;
        }
 
@@ -1180,7 +1182,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (rc) {
                err(msg_initialization_err, 6);
                err("%s: unable to save PCI configuration data, error %d\n",
-                       __FUNCTION__, rc);
+                       __func__, rc);
                goto err_iounmap;
        }