Commit 17ffba6a authored by NeilBrown's avatar NeilBrown Committed by Samuel Ortiz

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: default avatarNeilBrown <neilb@suse.de>
Acked-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 5500e396
...@@ -568,7 +568,6 @@ add_numbered_child(unsigned chip, const char *name, int num, ...@@ -568,7 +568,6 @@ add_numbered_child(unsigned chip, const char *name, int num,
goto err; goto err;
} }
device_init_wakeup(&pdev->dev, can_wakeup);
pdev->dev.parent = &twl->client->dev; pdev->dev.parent = &twl->client->dev;
if (pdata) { if (pdata) {
...@@ -593,6 +592,8 @@ add_numbered_child(unsigned chip, const char *name, int num, ...@@ -593,6 +592,8 @@ add_numbered_child(unsigned chip, const char *name, int num,
} }
status = platform_device_add(pdev); status = platform_device_add(pdev);
if (status == 0)
device_init_wakeup(&pdev->dev, can_wakeup);
err: err:
if (status < 0) { if (status < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment