From: Wei Yongjun Date: Sat, 7 Dec 2013 06:03:00 +0000 (+0800) Subject: mfd: sta2x11-mfd: Fix return value check in sta2x11_mfd_platform_probe() X-Git-Tag: next-20131210~38^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1cf1df1659027433040f1bfc94612a73d49feea0;p=karo-tx-linux.git 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 Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c index 53ab686c984f..0d42e40adb98 100644 --- a/drivers/mfd/sta2x11-mfd.c +++ b/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; mfd->regmap[index] = devm_regmap_init_mmio(&dev->dev, mfd->regs[index], regmap_config); - WARN_ON(!mfd->regmap[index]); + WARN_ON(IS_ERR(mfd->regmap[index])); return 0; }