Commit 47eaa8ba authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Pavel Machek

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 23bdfe00
...@@ -394,13 +394,10 @@ static int lm3692x_probe_dt(struct lm3692x_led *led) ...@@ -394,13 +394,10 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
led->regulator = devm_regulator_get_optional(&led->client->dev, "vled"); led->regulator = devm_regulator_get_optional(&led->client->dev, "vled");
if (IS_ERR(led->regulator)) { if (IS_ERR(led->regulator)) {
ret = PTR_ERR(led->regulator); ret = PTR_ERR(led->regulator);
if (ret != -ENODEV) { if (ret != -ENODEV)
if (ret != -EPROBE_DEFER) return dev_err_probe(&led->client->dev, ret,
dev_err(&led->client->dev, "Failed to get vled regulator\n");
"Failed to get vled regulator: %d\n",
ret);
return ret;
}
led->regulator = NULL; led->regulator = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment