Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288958
b: refs/heads/master
c: f27a551
h: refs/heads/master
v: v3
  • Loading branch information
Szymon Janc authored and Greg Kroah-Hartman committed Feb 9, 2012
1 parent b574712 commit 8c5dc12
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 60955f15d93198ef33081e01f46223c7bd534f1e
refs/heads/master: f27a551968bb8780c8a5255c0ea6c3a2fcaf4a47
22 changes: 14 additions & 8 deletions trunk/drivers/staging/quickstart/quickstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,29 +262,29 @@ static int quickstart_acpi_config(struct quickstart_acpi *quickstart, char *bid)

static int quickstart_acpi_add(struct acpi_device *device)
{
int ret = 0;
acpi_status status = AE_OK;
struct quickstart_acpi *quickstart = NULL;
int ret;
acpi_status status;
struct quickstart_acpi *quickstart;

if (!device)
return -EINVAL;

quickstart = kzalloc(sizeof(struct quickstart_acpi), GFP_KERNEL);
quickstart = kzalloc(sizeof(*quickstart), GFP_KERNEL);
if (!quickstart)
return -ENOMEM;

quickstart->device = device;

strcpy(acpi_device_name(device), QUICKSTART_ACPI_DEVICE_NAME);
strcpy(acpi_device_class(device), QUICKSTART_ACPI_CLASS);
device->driver_data = quickstart;

/* Add button to list and initialize some stuff */
ret = quickstart_acpi_config(quickstart, acpi_device_bid(device));
if (ret)
if (ret < 0)
goto fail_config;

status = acpi_install_notify_handler(device->handle,
ACPI_ALL_NOTIFY,
status = acpi_install_notify_handler(device->handle, ACPI_ALL_NOTIFY,
quickstart_acpi_notify,
quickstart);
if (ACPI_FAILURE(status)) {
Expand All @@ -293,10 +293,16 @@ static int quickstart_acpi_add(struct acpi_device *device)
goto fail_installnotify;
}

quickstart_acpi_ghid(quickstart);
ret = quickstart_acpi_ghid(quickstart);
if (ret < 0)
goto fail_ghid;

return 0;

fail_ghid:
acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY,
quickstart_acpi_notify);

fail_installnotify:
quickstart_btnlst_del(quickstart->btn);

Expand Down

0 comments on commit 8c5dc12

Please sign in to comment.