提交 d4cbca9e 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: tps80031: Use IS_ERR to check return value of regulator_register()

regulator_register() does not return NULL, it returns ERR_PTR on error.
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 949db153
...@@ -728,7 +728,7 @@ static int tps80031_regulator_probe(struct platform_device *pdev) ...@@ -728,7 +728,7 @@ static int tps80031_regulator_probe(struct platform_device *pdev)
} }
} }
rdev = regulator_register(&ri->rinfo->desc, &config); rdev = regulator_register(&ri->rinfo->desc, &config);
if (IS_ERR_OR_NULL(rdev)) { if (IS_ERR(rdev)) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"register regulator failed %s\n", "register regulator failed %s\n",
ri->rinfo->desc.name); ri->rinfo->desc.name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册