]> Git Repo - linux.git/commitdiff
ASoC: rt711: fix return value check in rt711_sdw_probe()
authorWei Yongjun <[email protected]>
Wed, 15 Jan 2020 14:30:34 +0000 (14:30 +0000)
committerMark Brown <[email protected]>
Fri, 17 Jan 2020 15:31:07 +0000 (15:31 +0000)
In case of error, the function devm_regmap_init() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: 320b8b0d13b8 ("ASoC: rt711: add rt711 codec driver")
Signed-off-by: Wei Yongjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sound/soc/codecs/rt711-sdw.c

index e28dc84ede5bd409f41a7288265e7f3dd3e6348f..85e62e1059cd050f098fcb30bd6dba0566828ac6 100644 (file)
@@ -460,8 +460,8 @@ static int rt711_sdw_probe(struct sdw_slave *slave,
 
        regmap = devm_regmap_init(&slave->dev, NULL,
                &slave->dev, &rt711_regmap);
-       if (!regmap)
-               return -EINVAL;
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
 
        rt711_init(&slave->dev, sdw_regmap, regmap, slave);
 
This page took 0.064664 seconds and 4 git commands to generate.