Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202477
b: refs/heads/master
c: a0dba69
h: refs/heads/master
i:
  202475: 3e4cc5c
v: v3
  • Loading branch information
Axel Lin authored and Matthew Garrett committed Aug 3, 2010
1 parent 02ea65c commit b374392
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 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: 6a984a06487129f013ee2df6ce98b6cfada1e7b1
refs/heads/master: a0dba697eec78fb2d4e2b76b83104a2b251ae70d
23 changes: 16 additions & 7 deletions trunk/drivers/platform/x86/acerhdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,17 +615,26 @@ static int acerhdf_register_platform(void)
return err;

acerhdf_dev = platform_device_alloc("acerhdf", -1);
platform_device_add(acerhdf_dev);
if (!acerhdf_dev) {
err = -ENOMEM;
goto err_device_alloc;
}
err = platform_device_add(acerhdf_dev);
if (err)
goto err_device_add;

return 0;

err_device_add:
platform_device_put(acerhdf_dev);
err_device_alloc:
platform_driver_unregister(&acerhdf_driver);
return err;
}

static void acerhdf_unregister_platform(void)
{
if (!acerhdf_dev)
return;

platform_device_del(acerhdf_dev);
platform_device_unregister(acerhdf_dev);
platform_driver_unregister(&acerhdf_driver);
}

Expand Down Expand Up @@ -669,7 +678,7 @@ static int __init acerhdf_init(void)

err = acerhdf_register_platform();
if (err)
goto err_unreg;
goto out_err;

err = acerhdf_register_thermal();
if (err)
Expand All @@ -682,7 +691,7 @@ static int __init acerhdf_init(void)
acerhdf_unregister_platform();

out_err:
return -ENODEV;
return err;
}

static void __exit acerhdf_exit(void)
Expand Down

0 comments on commit b374392

Please sign in to comment.