From: Colin Ian King Date: Thu, 29 Dec 2016 15:23:12 +0000 (+0000) Subject: power: supply: wm97xx_battery: remove redundant 2nd null check on pdata X-Git-Tag: v4.11-rc1~178^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3e774186d2c011680516b5c65d8197a2b489555;p=platform%2Fkernel%2Flinux-exynos.git power: supply: wm97xx_battery: remove redundant 2nd null check on pdata 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 Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/wm97xx_battery.c b/drivers/power/supply/wm97xx_battery.c index e3edb31..bd4f666 100644 --- a/drivers/power/supply/wm97xx_battery.c +++ b/drivers/power/supply/wm97xx_battery.c @@ -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)