]> Pileus Git - ~andy/linux/blobdiff - drivers/mfd/twl-core.c
Merge tag 'for-v3.6' of git://git.infradead.org/battery-2.6
[~andy/linux] / drivers / mfd / twl-core.c
index 269b296a0975705b782bea56e8a99a3c05f0bec6..1c32afed28aad0ade45943e6b20a6b7c22531e93 100644 (file)
@@ -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) {
@@ -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) {