Skip to content

Commit

Permalink
eeepc-laptop: fix led initialization order
Browse files Browse the repository at this point in the history
Create the workqueue thread used by tpd_led_set() *before* we register
the led device.  (And vice versa for unregistration).

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Alan Jenkins authored and Len Brown committed Dec 9, 2009
1 parent 4871868 commit 2b56f1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 2b56f1c

Please sign in to comment.