diff options
author | NeilBrown <neilb@suse.de> | 2012-07-06 18:51:03 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-09 09:13:41 -0400 |
commit | 17ffba6ad235cf9c21937ee1343df0d0fb2371fa (patch) | |
tree | 30cbac06fa6a4bc7a7b3b3e9f44e8e5063eb4e5a /drivers/mfd | |
parent | 5500e3964b8c154dc5af51ebcd7cd4df5d4abfee (diff) |
mfd: Move twl-core device_init_wakeup to after platform_device_add
device_init_wakeup uses the dev_name() of the device to set the
name of the wakeup_source which appears in
/sys/kernel/debug/wakeup_sources.
For a platform device, that name is not set until platform_device_add
calls dev_set_name.
So the call to device_init_wakeup() must be after the call to
platform_device_add().
Making this change causes correct names to appear in the
wakeup_sources file.
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/twl-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 6fc90befa79e..b012efd29e01 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -568,7 +568,6 @@ add_numbered_child(unsigned chip, const char *name, int num, | |||
568 | goto err; | 568 | goto err; |
569 | } | 569 | } |
570 | 570 | ||
571 | device_init_wakeup(&pdev->dev, can_wakeup); | ||
572 | pdev->dev.parent = &twl->client->dev; | 571 | pdev->dev.parent = &twl->client->dev; |
573 | 572 | ||
574 | if (pdata) { | 573 | if (pdata) { |
@@ -593,6 +592,8 @@ add_numbered_child(unsigned chip, const char *name, int num, | |||
593 | } | 592 | } |
594 | 593 | ||
595 | status = platform_device_add(pdev); | 594 | status = platform_device_add(pdev); |
595 | if (status == 0) | ||
596 | device_init_wakeup(&pdev->dev, can_wakeup); | ||
596 | 597 | ||
597 | err: | 598 | err: |
598 | if (status < 0) { | 599 | if (status < 0) { |