]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/sgi_hotplug.c
pciehp: use get_service_data
[linux-2.6] / drivers / pci / hotplug / sgi_hotplug.c
index ef07c36bccf7ea1b4868853080ce6717e7818233..410fe0394a8ea63fb8de8542654d514d2ec36992 100644 (file)
@@ -197,13 +197,15 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
 static struct hotplug_slot * sn_hp_destroy(void)
 {
        struct slot *slot;
+       struct pci_slot *pci_slot;
        struct hotplug_slot *bss_hotplug_slot = NULL;
 
        list_for_each_entry(slot, &sn_hp_list, hp_list) {
                bss_hotplug_slot = slot->hotplug_slot;
+               pci_slot = bss_hotplug_slot->pci_slot;
                list_del(&((struct slot *)bss_hotplug_slot->private)->
                         hp_list);
-               sysfs_remove_file(&bss_hotplug_slot->kobj,
+               sysfs_remove_file(&pci_slot->kobj,
                                  &sn_slot_path_attr.attr);
                break;
        }
@@ -367,7 +369,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
                ret = acpi_load_table((struct acpi_table_header *)ssdt);
                if (ACPI_FAILURE(ret)) {
                        printk(KERN_ERR "%s: acpi_load_table failed (0x%x)\n",
-                              __FUNCTION__, ret);
+                              __func__, ret);
                        /* try to continue on */
                }
        }
@@ -459,7 +461,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
                                if (ACPI_FAILURE(ret)) {
                                        printk(KERN_ERR "%s: acpi_bus_add "
                                               "failed (0x%x) for slot %d "
-                                              "func %d\n", __FUNCTION__,
+                                              "func %d\n", __func__,
                                               ret, (int)(adr>>16),
                                               (int)(adr&0xffff));
                                        /* try to continue on */
@@ -570,7 +572,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
                if (ACPI_FAILURE(ret)) {
                        printk(KERN_ERR "%s: acpi_unload_table_id "
                               "failed (0x%x) for id %d\n",
-                              __FUNCTION__, ret, ssdt_id);
+                              __func__, ret, ssdt_id);
                        /* try to continue on */
                }
        }
@@ -614,6 +616,7 @@ static void sn_release_slot(struct hotplug_slot *bss_hotplug_slot)
 static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
 {
        int device;
+       struct pci_slot *pci_slot;
        struct hotplug_slot *bss_hotplug_slot;
        int rc = 0;
 
@@ -650,11 +653,12 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
                bss_hotplug_slot->ops = &sn_hotplug_slot_ops;
                bss_hotplug_slot->release = &sn_release_slot;
 
-               rc = pci_hp_register(bss_hotplug_slot);
+               rc = pci_hp_register(bss_hotplug_slot, pci_bus, device);
                if (rc)
                        goto register_err;
 
-               rc = sysfs_create_file(&bss_hotplug_slot->kobj,
+               pci_slot = bss_hotplug_slot->pci_slot;
+               rc = sysfs_create_file(&pci_slot->kobj,
                                       &sn_slot_path_attr.attr);
                if (rc)
                        goto register_err;
@@ -664,7 +668,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
 
 register_err:
        dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n",
-               rc);
+               rc);
 
 alloc_err:
        if (rc == -ENOMEM)
@@ -689,7 +693,7 @@ static int sn_pci_hotplug_init(void)
 
        if (!sn_prom_feature_available(PRF_HOTPLUG_SUPPORT)) {
                printk(KERN_ERR "%s: PROM version does not support hotplug.\n",
-                      __FUNCTION__);
+                      __func__);
                return -EPERM;
        }