]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/acpiphp_ibm.c
Fix PCI hotplug printk format
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / acpiphp_ibm.c
index b0a22b92717e519d6ec82cb2a289ff4b14980f5b..881fdd2b7313d61afbf3d3299d166370d2152c75 100644 (file)
 #include <linux/kobject.h>
 #include <asm/uaccess.h>
 #include <linux/moduleparam.h>
+#include <linux/pci.h>
 
 #include "acpiphp.h"
+#include "../pci.h"
 
 #define DRIVER_VERSION "1.0.1"
 #define DRIVER_AUTHOR  "Irene Zubarev <zubarev@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>"
@@ -181,12 +183,12 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
        union acpi_object args[2]; 
        struct acpi_object_list params = { .pointer = args, .count = 2 };
        acpi_status stat; 
-       unsigned long rc;
+       unsigned long long rc;
        union apci_descriptor *ibm_slot;
 
        ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot));
 
-       dbg("%s: set slot %d (%d) attention status to %d\n", __FUNCTION__,
+       dbg("%s: set slot %d (%d) attention status to %d\n", __func__,
                        ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
                        (status ? 1 : 0));
 
@@ -202,7 +204,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
                err("APLS evaluation failed:  0x%08x\n", stat);
                return -ENODEV;
        } else if (!rc) {
-               err("APLS method failed:  0x%08lx\n", rc);
+               err("APLS method failed:  0x%08llx\n", rc);
                return -ERANGE;
        }
        return 0;
@@ -231,7 +233,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status)
        else
                *status = 0;
 
-       dbg("%s: get slot %d (%d) attention status is %d\n", __FUNCTION__,
+       dbg("%s: get slot %d (%d) attention status is %d\n", __func__,
                        ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
                        *status);
 
@@ -263,10 +265,10 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
        u8 subevent = event & 0xf0;
        struct notification *note = context;
 
-       dbg("%s: Received notification %02x\n", __FUNCTION__, event);
+       dbg("%s: Received notification %02x\n", __func__, event);
 
        if (subevent == 0x80) {
-               dbg("%s: generationg bus event\n", __FUNCTION__);
+               dbg("%s: generationg bus event\n", __func__);
                acpi_bus_generate_proc_event(note->device, note->event, detail);
                acpi_bus_generate_netlink_event(note->device->pnp.device_class,
                                                  note->device->dev.bus_id,
@@ -299,7 +301,7 @@ static int ibm_get_table_from_acpi(char **bufp)
 
        status = acpi_evaluate_object(ibm_acpi_handle, "APCI", NULL, &buffer);
        if (ACPI_FAILURE(status)) {
-               err("%s:  APCI evaluation failed\n", __FUNCTION__);
+               err("%s:  APCI evaluation failed\n", __func__);
                return -ENODEV;
        }
 
@@ -307,13 +309,13 @@ static int ibm_get_table_from_acpi(char **bufp)
        if (!(package) ||
                        (package->type != ACPI_TYPE_PACKAGE) ||
                        !(package->package.elements)) {
-               err("%s:  Invalid APCI object\n", __FUNCTION__);
+               err("%s:  Invalid APCI object\n", __func__);
                goto read_table_done;
        }
 
        for(size = 0, i = 0; i < package->package.count; i++) {
                if (package->package.elements[i].type != ACPI_TYPE_BUFFER) {
-                       err("%s:  Invalid APCI element %d\n", __FUNCTION__, i);
+                       err("%s:  Invalid APCI element %d\n", __func__, i);
                        goto read_table_done;
                }
                size += package->package.elements[i].buffer.length;
@@ -324,7 +326,7 @@ static int ibm_get_table_from_acpi(char **bufp)
 
        lbuf = kzalloc(size, GFP_KERNEL);
        dbg("%s: element count: %i, ASL table size: %i, &table = 0x%p\n",
-                       __FUNCTION__, package->package.count, size, lbuf);
+                       __func__, package->package.count, size, lbuf);
 
        if (lbuf) {
                *bufp = lbuf;
@@ -368,7 +370,7 @@ static ssize_t ibm_read_apci_table(struct kobject *kobj,
        int bytes_read = -EINVAL;
        char *table = NULL;
        
-       dbg("%s: pos = %d, size = %zd\n", __FUNCTION__, (int)pos, size);
+       dbg("%s: pos = %d, size = %zd\n", __func__, (int)pos, size);
 
        if (pos == 0) {
                bytes_read = ibm_get_table_from_acpi(&table);
@@ -402,7 +404,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
        status = acpi_get_object_info(handle, &info_buffer);
        if (ACPI_FAILURE(status)) {
                err("%s:  Failed to get device information status=0x%x\n",
-                       __FUNCTION__, status);
+                       __func__, status);
                return retval;
        }
        info = info_buffer.pointer;
@@ -430,20 +432,20 @@ static int __init ibm_acpiphp_init(void)
        int retval = 0;
        acpi_status status;
        struct acpi_device *device;
-       struct kobject *sysdir = &pci_hotplug_slots_kset->kobj;
+       struct kobject *sysdir = &pci_slots_kset->kobj;
 
-       dbg("%s\n", __FUNCTION__);
+       dbg("%s\n", __func__);
 
        if (acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
                        ACPI_UINT32_MAX, ibm_find_acpi_device,
                        &ibm_acpi_handle, NULL) != FOUND_APCI) {
-               err("%s: acpi_walk_namespace failed\n", __FUNCTION__);
+               err("%s: acpi_walk_namespace failed\n", __func__);
                retval = -ENODEV;
                goto init_return;
        }
-       dbg("%s: found IBM aPCI device\n", __FUNCTION__);
+       dbg("%s: found IBM aPCI device\n", __func__);
        if (acpi_bus_get_device(ibm_acpi_handle, &device)) {
-               err("%s: acpi_bus_get_device failed\n", __FUNCTION__);
+               err("%s: acpi_bus_get_device failed\n", __func__);
                retval = -ENODEV;
                goto init_return;
        }
@@ -458,7 +460,7 @@ static int __init ibm_acpiphp_init(void)
                        &ibm_note);
        if (ACPI_FAILURE(status)) {
                err("%s: Failed to register notification handler\n",
-                               __FUNCTION__);
+                               __func__);
                retval = -EBUSY;
                goto init_cleanup;
        }
@@ -477,19 +479,19 @@ init_return:
 static void __exit ibm_acpiphp_exit(void)
 {
        acpi_status status;
-       struct kobject *sysdir = &pci_hotplug_slots_kset->kobj;
+       struct kobject *sysdir = &pci_slots_kset->kobj;
 
-       dbg("%s\n", __FUNCTION__);
+       dbg("%s\n", __func__);
 
        if (acpiphp_unregister_attention(&ibm_attention_info))
-               err("%s: attention info deregistration failed", __FUNCTION__);
+               err("%s: attention info deregistration failed", __func__);
 
        status = acpi_remove_notify_handler(
                           ibm_acpi_handle,
                           ACPI_DEVICE_NOTIFY,
                           ibm_handle_events);
        if (ACPI_FAILURE(status))
-               err("%s: Notification handler removal failed\n", __FUNCTION__);
+               err("%s: Notification handler removal failed\n", __func__);
        /* remove the /sys entries */
        sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr);
 }