Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62893
b: refs/heads/master
c: 3b0d711
h: refs/heads/master
i:
  62891: 27aaf14
v: v3
  • Loading branch information
Al Viro authored and Len Brown committed Jul 23, 2007
1 parent c8d6852 commit 2097542
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 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: 3cc2649b879f0e83fd51b14c82bad5f8f208591e
refs/heads/master: 3b0d71170d37878bbb1203ebc3f92e36d6151a80
32 changes: 21 additions & 11 deletions trunk/drivers/misc/asus-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,19 +1067,16 @@ static void asus_backlight_exit(void)
}

#define ASUS_LED_UNREGISTER(object) \
if(object##_led.class_dev \
&& !IS_ERR(object##_led.class_dev)) \
led_classdev_unregister(&object##_led)
led_classdev_unregister(&object##_led)

static void asus_led_exit(void)
{
destroy_workqueue(led_workqueue);
ASUS_LED_UNREGISTER(mled);
ASUS_LED_UNREGISTER(tled);
ASUS_LED_UNREGISTER(pled);
ASUS_LED_UNREGISTER(rled);
ASUS_LED_UNREGISTER(gled);

destroy_workqueue(led_workqueue);
}

static void __exit asus_laptop_exit(void)
Expand Down Expand Up @@ -1135,29 +1132,42 @@ static int asus_led_init(struct device *dev)

rv = ASUS_LED_REGISTER(mled, dev);
if (rv)
return rv;
goto out;

rv = ASUS_LED_REGISTER(tled, dev);
if (rv)
return rv;
goto out1;

rv = ASUS_LED_REGISTER(rled, dev);
if (rv)
return rv;
goto out2;

rv = ASUS_LED_REGISTER(pled, dev);
if (rv)
return rv;
goto out3;

rv = ASUS_LED_REGISTER(gled, dev);
if (rv)
return rv;
goto out4;

led_workqueue = create_singlethread_workqueue("led_workqueue");
if (!led_workqueue)
return -ENOMEM;
goto out5;

return 0;
out5:
rv = -ENOMEM;
ASUS_LED_UNREGISTER(gled);
out4:
ASUS_LED_UNREGISTER(pled);
out3:
ASUS_LED_UNREGISTER(rled);
out2:
ASUS_LED_UNREGISTER(tled);
out1:
ASUS_LED_UNREGISTER(mled);
out:
return rv;
}

static int __init asus_laptop_init(void)
Expand Down

0 comments on commit 2097542

Please sign in to comment.