]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
power: supply: wm97xx_battery: remove redundant 2nd null check on pdata
authorColin Ian King <colin.king@canonical.com>
Thu, 29 Dec 2016 15:23:12 +0000 (15:23 +0000)
committerSebastian Reichel <sre@kernel.org>
Wed, 4 Jan 2017 21:04:20 +0000 (22:04 +0100)
pdata is being null checked twice, the 2nd check is redundant code
and can be removed.

Fixes CoverityScan CID 1392340 "Logically dead code"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/wm97xx_battery.c

index e3edb31ac88045a0071c78dff2f20a4a9cac0284..bd4f66651513f8bdcdd7fe419c706acd82058277 100644 (file)
@@ -175,11 +175,6 @@ static int wm97xx_bat_probe(struct platform_device *dev)
        if (dev->id != -1)
                return -EINVAL;
 
-       if (!pdata) {
-               dev_err(&dev->dev, "No platform_data supplied\n");
-               return -EINVAL;
-       }
-
        if (gpio_is_valid(pdata->charge_gpio)) {
                ret = gpio_request(pdata->charge_gpio, "BATT CHRG");
                if (ret)