Skip to content

Commit

Permalink
mfd: Move twl-core device_init_wakeup to after platform_device_add
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown authored and Samuel Ortiz committed Jul 9, 2012
1 parent 5500e39 commit 17ffba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mfd/twl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,6 @@ add_numbered_child(unsigned chip, const char *name, int num,
goto err;
}

device_init_wakeup(&pdev->dev, can_wakeup);
pdev->dev.parent = &twl->client->dev;

if (pdata) {
Expand All @@ -593,6 +592,8 @@ add_numbered_child(unsigned chip, const char *name, int num,
}

status = platform_device_add(pdev);
if (status == 0)
device_init_wakeup(&pdev->dev, can_wakeup);

err:
if (status < 0) {
Expand Down

0 comments on commit 17ffba6

Please sign in to comment.