mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
leds: lm3692x: Handle failure to probe the regulator
[ Upstream commit 396128d2ff ]
Instead use devm_regulator_get_optional since the regulator
is optional and check for errors.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
37958001e1
commit
af4eac2a28
@@ -334,9 +334,18 @@ static int lm3692x_probe_dt(struct lm3692x_led *led)
|
||||
return ret;
|
||||
}
|
||||
|
||||
led->regulator = devm_regulator_get(&led->client->dev, "vled");
|
||||
if (IS_ERR(led->regulator))
|
||||
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;
|
||||
}
|
||||
led->regulator = NULL;
|
||||
}
|
||||
|
||||
child = device_get_next_child_node(&led->client->dev, child);
|
||||
if (!child) {
|
||||
|
||||
Reference in New Issue
Block a user