Commit f27a5519 authored by Szymon Janc's avatar Szymon Janc Committed by Greg Kroah-Hartman

Staging: quickstart: Cleanup quickstart_acpi_add

Signed-off-by: default avatarSzymon Janc <szymon@janc.net.pl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60955f15
...@@ -262,29 +262,29 @@ static int quickstart_acpi_config(struct quickstart_acpi *quickstart, char *bid) ...@@ -262,29 +262,29 @@ static int quickstart_acpi_config(struct quickstart_acpi *quickstart, char *bid)
static int quickstart_acpi_add(struct acpi_device *device) static int quickstart_acpi_add(struct acpi_device *device)
{ {
int ret = 0; int ret;
acpi_status status = AE_OK; acpi_status status;
struct quickstart_acpi *quickstart = NULL; struct quickstart_acpi *quickstart;
if (!device) if (!device)
return -EINVAL; return -EINVAL;
quickstart = kzalloc(sizeof(struct quickstart_acpi), GFP_KERNEL); quickstart = kzalloc(sizeof(*quickstart), GFP_KERNEL);
if (!quickstart) if (!quickstart)
return -ENOMEM; return -ENOMEM;
quickstart->device = device; quickstart->device = device;
strcpy(acpi_device_name(device), QUICKSTART_ACPI_DEVICE_NAME); strcpy(acpi_device_name(device), QUICKSTART_ACPI_DEVICE_NAME);
strcpy(acpi_device_class(device), QUICKSTART_ACPI_CLASS); strcpy(acpi_device_class(device), QUICKSTART_ACPI_CLASS);
device->driver_data = quickstart; device->driver_data = quickstart;
/* Add button to list and initialize some stuff */ /* Add button to list and initialize some stuff */
ret = quickstart_acpi_config(quickstart, acpi_device_bid(device)); ret = quickstart_acpi_config(quickstart, acpi_device_bid(device));
if (ret) if (ret < 0)
goto fail_config; goto fail_config;
status = acpi_install_notify_handler(device->handle, status = acpi_install_notify_handler(device->handle, ACPI_ALL_NOTIFY,
ACPI_ALL_NOTIFY,
quickstart_acpi_notify, quickstart_acpi_notify,
quickstart); quickstart);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -293,10 +293,16 @@ static int quickstart_acpi_add(struct acpi_device *device) ...@@ -293,10 +293,16 @@ static int quickstart_acpi_add(struct acpi_device *device)
goto fail_installnotify; goto fail_installnotify;
} }
quickstart_acpi_ghid(quickstart); ret = quickstart_acpi_ghid(quickstart);
if (ret < 0)
goto fail_ghid;
return 0; return 0;
fail_ghid:
acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY,
quickstart_acpi_notify);
fail_installnotify: fail_installnotify:
quickstart_btnlst_del(quickstart->btn); quickstart_btnlst_del(quickstart->btn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment