regulator: rk808: simplify one error branch with dev_err_probe
PATCH 1/1 regulator: rk808: simplify one error branch with dev_err_probe
This has the added benefit of recording the error message.
Signed-off-by Ahmad Fatoum <[email protected]>
--- drivers/regulator/rk808-regulator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/regulator/rk808-regulator.c +3 -4
@@ -783,10 +783,9 @@ static int rk808_regulator_register(struct rk808 *rk808, int id, cfg->rdev.regmap = rk808->regmap; ret =of_regulator_register (&cfg->rdev, match->of_node); -if (ret) { -dev_err (dev,"failed to register %s regulator\n" , match->name); -return ret; - } +if (ret) +return dev_err_probe (dev, ret,"failed to register %s regulator\n" , + match->name);dev_dbg (dev,"registered %s\n" , match->name);
Signature · 1 line
2.38.1
Sascha Hauer
AppliedQuoted 6 lines · Ahmad Fatoum
This has the added benefit of recording the error message.
Signed-off-by Ahmad Fatoum <[email protected]>--- drivers/regulator/rk808-regulator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Applied, thanks
Sascha
Quoted 24 lines
drivers/regulator/rk808-regulator.c +3
-4@@ -783,10 +783,9 @@ static int rk808_regulator_register(struct rk808 *rk808, int id, cfg->rdev.regmap = rk808->regmap; ret =of_regulator_register (&cfg->rdev, match->of_node); -if (ret) { -dev_err (dev,"failed to register %s regulator\n" , match->name); -return ret; - } +if (ret) +return dev_err_probe (dev, ret,"failed to register %s regulator\n" , + match->name);dev_dbg (dev,"registered %s\n" , match->name);Signature · 1 line
2.38.1
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |