drm/bridge: sii902x: Use devm_regulator_bulk_get_enable()
[ Upstream commit ff1eae1201a46f997126297d2d3440baa2d1b9a9 ] Simplify using devm_regulator_bulk_get_enable() Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Acked-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/e6153c7beb2076b9ea13082b2024ec3296bc08bc.1669799805.git.mazziesaccount@gmail.com Stable-dep-of: 08ac6f132dd7 ("drm/bridge: sii902x: Fix probing race issue") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ed555f5b5c
commit
c46f9c7f93
@ -171,7 +171,6 @@ struct sii902x {
|
||||
struct drm_connector connector;
|
||||
struct gpio_desc *reset_gpio;
|
||||
struct i2c_mux_core *i2cmux;
|
||||
struct regulator_bulk_data supplies[2];
|
||||
bool sink_is_hdmi;
|
||||
/*
|
||||
* Mutex protects audio and video functions from interfering
|
||||
@ -1072,6 +1071,7 @@ static int sii902x_probe(struct i2c_client *client,
|
||||
struct device *dev = &client->dev;
|
||||
struct device_node *endpoint;
|
||||
struct sii902x *sii902x;
|
||||
static const char * const supplies[] = {"iovcc", "cvcc12"};
|
||||
int ret;
|
||||
|
||||
ret = i2c_check_functionality(client->adapter,
|
||||
@ -1122,27 +1122,11 @@ static int sii902x_probe(struct i2c_client *client,
|
||||
|
||||
mutex_init(&sii902x->mutex);
|
||||
|
||||
sii902x->supplies[0].supply = "iovcc";
|
||||
sii902x->supplies[1].supply = "cvcc12";
|
||||
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
|
||||
sii902x->supplies);
|
||||
ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(supplies), supplies);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return dev_err_probe(dev, ret, "Failed to enable supplies");
|
||||
|
||||
ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
|
||||
sii902x->supplies);
|
||||
if (ret < 0) {
|
||||
dev_err_probe(dev, ret, "Failed to enable supplies");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = sii902x_init(sii902x);
|
||||
if (ret < 0) {
|
||||
regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
|
||||
sii902x->supplies);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return sii902x_init(sii902x);
|
||||
}
|
||||
|
||||
static void sii902x_remove(struct i2c_client *client)
|
||||
@ -1152,8 +1136,6 @@ static void sii902x_remove(struct i2c_client *client)
|
||||
|
||||
i2c_mux_del_adapters(sii902x->i2cmux);
|
||||
drm_bridge_remove(&sii902x->bridge);
|
||||
regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
|
||||
sii902x->supplies);
|
||||
}
|
||||
|
||||
static const struct of_device_id sii902x_dt_ids[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user