Commit a6df3fd9 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: TFP410: use devm_gpio_request_one

Use devm_ version instead of the regular gpio_request_one to simplify
the error handling.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f075a594
...@@ -119,8 +119,8 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -119,8 +119,8 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
} }
if (gpio_is_valid(ddata->pd_gpio)) { if (gpio_is_valid(ddata->pd_gpio)) {
r = gpio_request_one(ddata->pd_gpio, GPIOF_OUT_INIT_LOW, r = devm_gpio_request_one(&dssdev->dev, ddata->pd_gpio,
"tfp410 pd"); GPIOF_OUT_INIT_LOW, "tfp410 pd");
if (r) { if (r) {
dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n", dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n",
ddata->pd_gpio); ddata->pd_gpio);
...@@ -135,8 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -135,8 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
if (!adapter) { if (!adapter) {
dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n",
i2c_bus_num); i2c_bus_num);
r = -EINVAL; return -EINVAL;
goto err_i2c;
} }
ddata->i2c_adapter = adapter; ddata->i2c_adapter = adapter;
...@@ -145,10 +144,6 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -145,10 +144,6 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
dev_set_drvdata(&dssdev->dev, ddata); dev_set_drvdata(&dssdev->dev, ddata);
return 0; return 0;
err_i2c:
if (gpio_is_valid(ddata->pd_gpio))
gpio_free(ddata->pd_gpio);
return r;
} }
static void __exit tfp410_remove(struct omap_dss_device *dssdev) static void __exit tfp410_remove(struct omap_dss_device *dssdev)
...@@ -160,9 +155,6 @@ static void __exit tfp410_remove(struct omap_dss_device *dssdev) ...@@ -160,9 +155,6 @@ static void __exit tfp410_remove(struct omap_dss_device *dssdev)
if (ddata->i2c_adapter) if (ddata->i2c_adapter)
i2c_put_adapter(ddata->i2c_adapter); i2c_put_adapter(ddata->i2c_adapter);
if (gpio_is_valid(ddata->pd_gpio))
gpio_free(ddata->pd_gpio);
dev_set_drvdata(&dssdev->dev, NULL); dev_set_drvdata(&dssdev->dev, NULL);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
......
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