Skip to content

Commit

Permalink
ASoC: rt700: fix return value check in rt700_sdw_probe()
Browse files Browse the repository at this point in the history
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: 7d2a5f9 ("ASoC: rt700: add rt700 codec driver")
Signed-off-by: Wei Yongjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Wei Yongjun authored and broonie committed Jan 17, 2020
1 parent a62c449 commit 20435df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/rt700-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ static int rt700_sdw_probe(struct sdw_slave *slave,

regmap = devm_regmap_init(&slave->dev, NULL,
&slave->dev, &rt700_regmap);
if (!regmap)
return -EINVAL;
if (IS_ERR(regmap))
return PTR_ERR(regmap);

rt700_init(&slave->dev, sdw_regmap, regmap, slave);

Expand Down

0 comments on commit 20435df

Please sign in to comment.