summaryrefslogtreecommitdiff
path: root/drivers/acpi/bay.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 11:21:27 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-16 11:21:27 +0200
commit688d22e23ab1caacb2c36c615854294b58f2ea47 (patch)
tree95c8163c0b1f56902f5537bc256d7e5507f56cee /drivers/acpi/bay.c
parent7e0edc1bc343231029084761ebf59e522902eb49 (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
Merge branch 'linus' into x86/xentip-x86-xen-2008-06-16_09.21_Mon
Diffstat (limited to 'drivers/acpi/bay.c')
-rw-r--r--drivers/acpi/bay.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
index d2fc94161848..26038c2a2a71 100644
--- a/drivers/acpi/bay.c
+++ b/drivers/acpi/bay.c
@@ -301,16 +301,20 @@ static int bay_add(acpi_handle handle, int id)
*/
pdev->dev.uevent_suppress = 0;
- if (acpi_bay_add_fs(new_bay)) {
- platform_device_unregister(new_bay->pdev);
- goto bay_add_err;
- }
-
/* register for events on this device */
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
bay_notify, new_bay);
if (ACPI_FAILURE(status)) {
- printk(KERN_ERR PREFIX "Error installing bay notify handler\n");
+ printk(KERN_INFO PREFIX "Error installing bay notify handler\n");
+ platform_device_unregister(new_bay->pdev);
+ goto bay_add_err;
+ }
+
+ if (acpi_bay_add_fs(new_bay)) {
+ acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+ bay_notify);
+ platform_device_unregister(new_bay->pdev);
+ goto bay_add_err;
}
/* if we are on a dock station, we should register for dock