浏览代码

mfd: sta2x11-mfd: Fix return value check in sta2x11_mfd_platform_probe()

In case of error, the function devm_regmap_init_mmio() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Wei Yongjun 11 年之前
父节点
当前提交
ec9e4ba67e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mfd/sta2x11-mfd.c

+ 1 - 1
drivers/mfd/sta2x11-mfd.c

@@ -339,7 +339,7 @@ static int sta2x11_mfd_platform_probe(struct platform_device *dev,
 	regmap_config->cache_type = REGCACHE_NONE;
 	regmap_config->cache_type = REGCACHE_NONE;
 	mfd->regmap[index] = devm_regmap_init_mmio(&dev->dev, mfd->regs[index],
 	mfd->regmap[index] = devm_regmap_init_mmio(&dev->dev, mfd->regs[index],
 						   regmap_config);
 						   regmap_config);
-	WARN_ON(!mfd->regmap[index]);
+	WARN_ON(IS_ERR(mfd->regmap[index]));
 
 
 	return 0;
 	return 0;
 }
 }