Skip to content

Commit

Permalink
ACPI: acpi_device_register() should call device_register()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Chiang authored and Len Brown committed Jun 18, 2009
1 parent ab46fea commit 8b12b92
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8b12b92

Please sign in to comment.