Skip to content

Commit

Permalink
regulator: rk808: Use dev_err_probe() in the probe path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dragan Simic authored and Mark Brown committed Oct 22, 2024
1 parent a2f8996 commit bbc1baa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/regulator/rk808-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1843,8 +1843,8 @@ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map
pdata->dvs_gpio[i] =
devm_gpiod_get_index_optional(dev, "dvs", i, GPIOD_OUT_LOW);
if (IS_ERR(pdata->dvs_gpio[i])) {
ret = PTR_ERR(pdata->dvs_gpio[i]);
dev_err(dev, "failed to get dvs%d gpio (%d)\n", i, ret);
ret = dev_err_probe(dev, PTR_ERR(pdata->dvs_gpio[i]),
"failed to get dvs%d gpio\n", i);
goto dt_parse_end;
}

Expand Down Expand Up @@ -1920,9 +1920,8 @@ static int rk808_regulator_probe(struct platform_device *pdev)
nregulators = RK818_NUM_REGULATORS;
break;
default:
dev_err(&pdev->dev, "unsupported RK8XX ID %lu\n",
rk808->variant);
return -EINVAL;
return dev_err_probe(&pdev->dev, -EINVAL,
"unsupported RK8xx ID %lu\n", rk808->variant);
}

config.dev = &pdev->dev;
Expand Down

0 comments on commit bbc1baa

Please sign in to comment.