Remove blkdev warning triggered by using md
[safe/jmp/linux-2.6] / drivers / acpi / pci_bind.c
index 70b440f..4b252ea 100644 (file)
@@ -36,7 +36,7 @@
 #include <acpi/acpi_drivers.h>
 
 #define _COMPONENT             ACPI_PCI_COMPONENT
-ACPI_MODULE_NAME("pci_bind")
+ACPI_MODULE_NAME("pci_bind");
 
 struct acpi_pci_data {
        struct acpi_pci_id id;
@@ -44,6 +44,8 @@ struct acpi_pci_data {
        struct pci_dev *dev;
 };
 
+static int acpi_pci_unbind(struct acpi_device *device);
+
 static void acpi_pci_data_handler(acpi_handle handle, u32 function,
                                  void *context)
 {
@@ -122,19 +124,17 @@ int acpi_pci_bind(struct acpi_device *device)
        if (!device || !device->parent)
                return -EINVAL;
 
-       pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
+       pathname = kzalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
                return -ENOMEM;
-       memset(pathname, 0, ACPI_PATHNAME_MAX);
        buffer.length = ACPI_PATHNAME_MAX;
        buffer.pointer = pathname;
 
-       data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
+       data = kzalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
        if (!data) {
                kfree(pathname);
                return -ENOMEM;
        }
-       memset(data, 0, sizeof(struct acpi_pci_data));
 
        acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI device [%s]...\n",
@@ -269,7 +269,7 @@ int acpi_pci_bind(struct acpi_device *device)
        return result;
 }
 
-int acpi_pci_unbind(struct acpi_device *device)
+static int acpi_pci_unbind(struct acpi_device *device)
 {
        int result = 0;
        acpi_status status = AE_OK;
@@ -281,10 +281,9 @@ int acpi_pci_unbind(struct acpi_device *device)
        if (!device || !device->parent)
                return -EINVAL;
 
-       pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
+       pathname = kzalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
                return -ENOMEM;
-       memset(pathname, 0, ACPI_PATHNAME_MAX);
 
        buffer.length = ACPI_PATHNAME_MAX;
        buffer.pointer = pathname;
@@ -297,9 +296,6 @@ int acpi_pci_unbind(struct acpi_device *device)
            acpi_get_data(device->handle, acpi_pci_data_handler,
                          (void **)&data);
        if (ACPI_FAILURE(status)) {
-               ACPI_EXCEPTION((AE_INFO, status,
-                               "Unable to get data from device %s",
-                               acpi_device_bid(device)));
                result = -ENODEV;
                goto end;
        }
@@ -331,11 +327,9 @@ acpi_pci_bind_root(struct acpi_device *device,
        char *pathname = NULL;
        struct acpi_buffer buffer = { 0, NULL };
 
-
-       pathname = kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
+       pathname = kzalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);
        if (!pathname)
                return -ENOMEM;
-       memset(pathname, 0, ACPI_PATHNAME_MAX);
 
        buffer.length = ACPI_PATHNAME_MAX;
        buffer.pointer = pathname;
@@ -345,12 +339,11 @@ acpi_pci_bind_root(struct acpi_device *device,
                return -EINVAL;
        }
 
-       data = kmalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
+       data = kzalloc(sizeof(struct acpi_pci_data), GFP_KERNEL);
        if (!data) {
                kfree(pathname);
                return -ENOMEM;
        }
-       memset(data, 0, sizeof(struct acpi_pci_data));
 
        data->id = *id;
        data->bus = bus;