Skip to content

Commit bbc1baa

Browse files
Dragan Simicbroonie
authored andcommitted
regulator: rk808: Use dev_err_probe() in the probe path
Improve error handling in the probe path by using function dev_err_probe() instead of function dev_err(), where appropriate. Signed-off-by: Dragan Simic <dsimic@manjaro.org> Link: https://patch.msgid.link/2bfd889a35b1b0454952ec8180a53143bd860192.1728902488.git.dsimic@manjaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a2f8996 commit bbc1baa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/regulator/rk808-regulator.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,8 +1843,8 @@ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map
18431843
pdata->dvs_gpio[i] =
18441844
devm_gpiod_get_index_optional(dev, "dvs", i, GPIOD_OUT_LOW);
18451845
if (IS_ERR(pdata->dvs_gpio[i])) {
1846-
ret = PTR_ERR(pdata->dvs_gpio[i]);
1847-
dev_err(dev, "failed to get dvs%d gpio (%d)\n", i, ret);
1846+
ret = dev_err_probe(dev, PTR_ERR(pdata->dvs_gpio[i]),
1847+
"failed to get dvs%d gpio\n", i);
18481848
goto dt_parse_end;
18491849
}
18501850

@@ -1920,9 +1920,8 @@ static int rk808_regulator_probe(struct platform_device *pdev)
19201920
nregulators = RK818_NUM_REGULATORS;
19211921
break;
19221922
default:
1923-
dev_err(&pdev->dev, "unsupported RK8XX ID %lu\n",
1924-
rk808->variant);
1925-
return -EINVAL;
1923+
return dev_err_probe(&pdev->dev, -EINVAL,
1924+
"unsupported RK8xx ID %lu\n", rk808->variant);
19261925
}
19271926

19281927
config.dev = &pdev->dev;

0 commit comments

Comments
 (0)