]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/acpiphp_glue.c
Merge branch 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / acpiphp_glue.c
index 91156f85a9267371c1c9354646bdcc6975e206af..955aae4071f7a64eeb5cb716aaacf8ebb26c7a11 100644 (file)
@@ -169,7 +169,9 @@ static int post_dock_fixups(struct notifier_block *nb, unsigned long val,
 }
 
 
-
+static struct acpi_dock_ops acpiphp_dock_ops = {
+       .handler = handle_hotplug_event_func,
+};
 
 /* callback routine to register each ACPI PCI slot object */
 static acpi_status
@@ -180,7 +182,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
        struct acpiphp_func *newfunc;
        acpi_handle tmp;
        acpi_status status = AE_OK;
-       unsigned long adr, sun;
+       unsigned long long adr, sun;
        int device, function, retval;
 
        status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
@@ -258,7 +260,12 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
                                bridge->pci_bus->number, slot->device);
                retval = acpiphp_register_hotplug_slot(slot);
                if (retval) {
-                       warn("acpiphp_register_hotplug_slot failed(err code = 0x%x)\n", retval);
+                       if (retval == -EBUSY)
+                               warn("Slot %d already registered by another "
+                                       "hotplug driver\n", slot->sun);
+                       else
+                               warn("acpiphp_register_hotplug_slot failed "
+                                       "(err code = 0x%x)\n", retval);
                        goto err_exit;
                }
        }
@@ -280,7 +287,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
                 */
                newfunc->flags &= ~FUNC_HAS_EJ0;
                if (register_hotplug_dock_device(handle,
-                       handle_hotplug_event_func, newfunc))
+                       &acpiphp_dock_ops, newfunc))
                        dbg("failed to register dock device\n");
 
                /* we need to be notified when dock events happen
@@ -523,7 +530,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
        acpi_status status;
        acpi_handle dummy_handle;
-       unsigned long tmp;
+       unsigned long long tmp;
        int device, function;
        struct pci_dev *dev;
        struct pci_bus *pci_bus = context;
@@ -568,7 +575,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
 static int add_bridge(acpi_handle handle)
 {
        acpi_status status;
-       unsigned long tmp;
+       unsigned long long tmp;
        int seg, bus;
        acpi_handle dummy_handle;
        struct pci_bus *pci_bus;
@@ -762,7 +769,7 @@ static int get_gsi_base(acpi_handle handle, u32 *gsi_base)
 {
        acpi_status status;
        int result = -1;
-       unsigned long gsb;
+       unsigned long long gsb;
        struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
        union acpi_object *obj;
        void *table;
@@ -803,7 +810,7 @@ static acpi_status
 ioapic_add(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
        acpi_status status;
-       unsigned long sta;
+       unsigned long long sta;
        acpi_handle tmp;
        struct pci_dev *pdev;
        u32 gsi_base;
@@ -867,7 +874,7 @@ static acpi_status
 ioapic_remove(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
        acpi_status status;
-       unsigned long sta;
+       unsigned long long sta;
        acpi_handle tmp;
        u32 gsi_base;
        struct acpiphp_ioapic *pos, *n, *ioapic = NULL;
@@ -1259,7 +1266,7 @@ static int disable_device(struct acpiphp_slot *slot)
 static unsigned int get_slot_status(struct acpiphp_slot *slot)
 {
        acpi_status status;
-       unsigned long sta = 0;
+       unsigned long long sta = 0;
        u32 dvid;
        struct list_head *l;
        struct acpiphp_func *func;
@@ -1878,19 +1885,3 @@ u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot)
 
        return (sta == 0) ? 0 : 1;
 }
-
-
-/*
- * pci address (seg/bus/dev)
- */
-u32 acpiphp_get_address(struct acpiphp_slot *slot)
-{
-       u32 address;
-       struct pci_bus *pci_bus = slot->bridge->pci_bus;
-
-       address = (pci_domain_nr(pci_bus) << 16) |
-                 (pci_bus->number << 8) |
-                 slot->device;
-
-       return address;
-}