diff mbox

[13/33] eeepc-laptop: fix led initialization order

Message ID 1259826317-18809-14-git-send-email-corentincj@iksaif.net (mailing list archive)
State Accepted
Delegated to: Len Brown
Headers show

Commit Message

Corentin Chary Dec. 3, 2009, 7:44 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 6c982d6..ac45faf 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1074,10 +1074,10 @@  static void eeepc_hwmon_exit(void)
 
 static void eeepc_led_exit(void)
 {
-	if (led_workqueue)
-		destroy_workqueue(led_workqueue);
 	if (tpd_led.dev)
 		led_classdev_unregister(&tpd_led);
+	if (led_workqueue)
+		destroy_workqueue(led_workqueue);
 }
 
 static int eeepc_new_rfkill(struct rfkill **rfkill,
@@ -1243,14 +1243,14 @@  static int eeepc_led_init(struct device *dev)
 	if (get_acpi(CM_ASL_TPD) == -ENODEV)
 		return 0;
 
-	rv = led_classdev_register(dev, &tpd_led);
-	if (rv)
-		return rv;
-
 	led_workqueue = create_singlethread_workqueue("led_workqueue");
 	if (!led_workqueue)
 		return -ENOMEM;
 
+	rv = led_classdev_register(dev, &tpd_led);
+	if (rv)
+		return rv;
+
 	return 0;
 }