summaryrefslogtreecommitdiff
path: root/drivers/acpi/bay.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-25 12:27:29 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-25 12:27:29 +0200
commit5ce001b0e56638c726270d4f9e05d46d4250dfbb (patch)
treec21cf007ddef99d5e8b23dde9621bd9152e676a8 /drivers/acpi/bay.c
parent7c9f8861e6c9c839f913e49b98c3854daca18f27 (diff)
parent543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff)
Merge branch 'linus' into stackprotectortip-stackprotector-2008-06-25_10.27_Wed
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