mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
leds: lm3692x: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
23bdfe0042
commit
47eaa8ba12
@ -394,13 +394,10 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
|
||||
led->regulator = devm_regulator_get_optional(&led->client->dev, "vled");
|
||||
if (IS_ERR(led->regulator)) {
|
||||
ret = PTR_ERR(led->regulator);
|
||||
if (ret != -ENODEV) {
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(&led->client->dev,
|
||||
"Failed to get vled regulator: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
if (ret != -ENODEV)
|
||||
return dev_err_probe(&led->client->dev, ret,
|
||||
"Failed to get vled regulator\n");
|
||||
|
||||
led->regulator = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user