ACPI: acpi_device_register() should call device_register()
authorAlex Chiang <achiang@hp.com>
Thu, 14 May 2009 14:31:32 +0000 (08:31 -0600)
committerLen Brown <len.brown@intel.com>
Thu, 18 Jun 2009 02:57:03 +0000 (22:57 -0400)
There is no apparent reason for acpi_device_register() to manually
register a new device in two steps (initialize then add).

Just call device_register() directly.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/scan.c

index 8ff510b..b8f5c00 100644 (file)
@@ -530,11 +530,10 @@ static int acpi_device_register(struct acpi_device *device,
        if (device->parent)
                device->dev.parent = &parent->dev;
        device->dev.bus = &acpi_bus_type;
-       device_initialize(&device->dev);
        device->dev.release = &acpi_device_release;
-       result = device_add(&device->dev);
+       result = device_register(&device->dev);
        if(result) {
-               dev_err(&device->dev, "Error adding device\n");
+               dev_err(&device->dev, "Error registering device\n");
                goto end;
        }