瀏覽代碼

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 <colin.king@canonical.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Colin Ian King 8 年之前
父節點
當前提交
e3e774186d
共有 1 個文件被更改,包括 0 次插入5 次删除
  1. 0 5
      drivers/power/supply/wm97xx_battery.c

+ 0 - 5
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)