aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-04 03:52:19 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-07 13:02:09 -0400
commita6df3fd963e3a0065418621edb30737d11c6662b (patch)
treef6f56f7922c4db565a2070c76db2790f1cfc333a /drivers
parentf075a594d7b6296a3bd003f3f60282f30471d7ac (diff)
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: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/displays/panel-tfp410.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c
index 4be9a59664d5..383811cf8648 100644
--- a/drivers/video/omap2/displays/panel-tfp410.c
+++ b/drivers/video/omap2/displays/panel-tfp410.c
@@ -119,8 +119,8 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
119 } 119 }
120 120
121 if (gpio_is_valid(ddata->pd_gpio)) { 121 if (gpio_is_valid(ddata->pd_gpio)) {
122 r = gpio_request_one(ddata->pd_gpio, GPIOF_OUT_INIT_LOW, 122 r = devm_gpio_request_one(&dssdev->dev, ddata->pd_gpio,
123 "tfp410 pd"); 123 GPIOF_OUT_INIT_LOW, "tfp410 pd");
124 if (r) { 124 if (r) {
125 dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n", 125 dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n",
126 ddata->pd_gpio); 126 ddata->pd_gpio);
@@ -135,8 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
135 if (!adapter) { 135 if (!adapter) {
136 dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", 136 dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n",
137 i2c_bus_num); 137 i2c_bus_num);
138 r = -EINVAL; 138 return -EINVAL;
139 goto err_i2c;
140 } 139 }
141 140
142 ddata->i2c_adapter = adapter; 141 ddata->i2c_adapter = adapter;
@@ -145,10 +144,6 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
145 dev_set_drvdata(&dssdev->dev, ddata); 144 dev_set_drvdata(&dssdev->dev, ddata);
146 145
147 return 0; 146 return 0;
148err_i2c:
149 if (gpio_is_valid(ddata->pd_gpio))
150 gpio_free(ddata->pd_gpio);
151 return r;
152} 147}
153 148
154static void __exit tfp410_remove(struct omap_dss_device *dssdev) 149static void __exit tfp410_remove(struct omap_dss_device *dssdev)
@@ -160,9 +155,6 @@ static void __exit tfp410_remove(struct omap_dss_device *dssdev)
160 if (ddata->i2c_adapter) 155 if (ddata->i2c_adapter)
161 i2c_put_adapter(ddata->i2c_adapter); 156 i2c_put_adapter(ddata->i2c_adapter);
162 157
163 if (gpio_is_valid(ddata->pd_gpio))
164 gpio_free(ddata->pd_gpio);
165
166 dev_set_drvdata(&dssdev->dev, NULL); 158 dev_set_drvdata(&dssdev->dev, NULL);
167 159
168 mutex_unlock(&ddata->lock); 160 mutex_unlock(&ddata->lock);