pm2301_charger: Return error if create_singlethread_workqueue fails
authorAxel Lin <axel.lin@ingics.com>
Thu, 16 May 2013 13:17:04 +0000 (21:17 +0800)
committerAnton Vorontsov <anton@enomsg.org>
Fri, 7 Jun 2013 00:25:48 +0000 (17:25 -0700)
Return error instead of 0 if create_singlethread_workqueue call fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
drivers/power/pm2301_charger.c

index bb346be..1c0bfcb 100644 (file)
@@ -1075,9 +1075,9 @@ static int pm2xxx_wall_charger_probe(struct i2c_client *i2c_client,
        pm2->ac_chg.external = true;
 
        /* Create a work queue for the charger */
-       pm2->charger_wq =
-               create_singlethread_workqueue("pm2xxx_charger_wq");
+       pm2->charger_wq = create_singlethread_workqueue("pm2xxx_charger_wq");
        if (pm2->charger_wq == NULL) {
+               ret = -ENOMEM;
                dev_err(pm2->dev, "failed to create work queue\n");
                goto free_device_info;
        }