Commit a92bf307 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

drm/bridge: ps8622: Pass flags to devm_gpiod_get()

Since 39b2bbe3 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Use this to simplify the driver. Furthermore this is one caller less
that stops us making the flags argument to gpiod_get*() mandatory.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 394e5b6d
...@@ -581,31 +581,21 @@ static int ps8622_probe(struct i2c_client *client, ...@@ -581,31 +581,21 @@ static int ps8622_probe(struct i2c_client *client,
ps8622->v12 = NULL; ps8622->v12 = NULL;
} }
ps8622->gpio_slp = devm_gpiod_get(dev, "sleep"); ps8622->gpio_slp = devm_gpiod_get(dev, "sleep", GPIOD_OUT_HIGH);
if (IS_ERR(ps8622->gpio_slp)) { if (IS_ERR(ps8622->gpio_slp)) {
ret = PTR_ERR(ps8622->gpio_slp); ret = PTR_ERR(ps8622->gpio_slp);
dev_err(dev, "cannot get gpio_slp %d\n", ret); dev_err(dev, "cannot get gpio_slp %d\n", ret);
return ret; return ret;
} }
ret = gpiod_direction_output(ps8622->gpio_slp, 1);
if (ret) {
dev_err(dev, "cannot configure gpio_slp\n");
return ret;
}
ps8622->gpio_rst = devm_gpiod_get(dev, "reset");
if (IS_ERR(ps8622->gpio_rst)) {
ret = PTR_ERR(ps8622->gpio_rst);
dev_err(dev, "cannot get gpio_rst %d\n", ret);
return ret;
}
/* /*
* Assert the reset pin high to avoid the bridge being * Assert the reset pin high to avoid the bridge being
* initialized prematurely * initialized prematurely
*/ */
ret = gpiod_direction_output(ps8622->gpio_rst, 1); ps8622->gpio_rst = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (ret) { if (IS_ERR(ps8622->gpio_rst)) {
dev_err(dev, "cannot configure gpio_rst\n"); ret = PTR_ERR(ps8622->gpio_rst);
dev_err(dev, "cannot get gpio_rst %d\n", ret);
return ret; return ret;
} }
......
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