The driver uses separate error printing and error returning at probe()
for locations where the error value is hard-coded and can't be
EPROBE_DEFER. This helps to omit the extra return value check which is
done in dev_err_probe().
Using the dev_err_probe() has some other benefits besides handling the
-EPROBE_DEFER though, like standardizing the print for error numbers.
Some believe thes outweigh the benefit of skipping the extra check.
Use dev_err_probe() consistently in the
bd71828 power-supply probe.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/aWi_GG74sZRfajA_@mva-rohm
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
pwr->regmap = dev_get_regmap(pdev->dev.parent, NULL);
else
pwr->regmap = dev_get_regmap(pdev->dev.parent, "wrap-map");
- if (!pwr->regmap) {
- dev_err(&pdev->dev, "No parent regmap\n");
- return -EINVAL;
- }
+ if (!pwr->regmap)
+ return dev_err_probe(&pdev->dev, -EINVAL, "No parent regmap\n");
pwr->dev = &pdev->dev;
dev_dbg(pwr->dev, "Found ROHM BD72720\n");
break;
default:
- dev_err(pwr->dev, "Unknown PMIC\n");
- return -EINVAL;
+ return dev_err_probe(pwr->dev, -EINVAL, "Unknown PMIC\n");
}
ret = bd7182x_get_rsens(pwr);