diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-01-26 05:32:34 -0500 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-01-28 15:50:11 -0500 |
commit | f8bd493456c3da372ae81ed8f6b903f6207b9d98 (patch) | |
tree | 2f81cc7fa93df9025eb281ee9c2843d09b5201e6 /drivers/video/msm | |
parent | 1c16697bf9d5b206cb0d2b905a54de5e077296be (diff) |
video: use gpio_request_one
Using gpio_request_one can make the code simpler because it can
set the direction and initial value in one shot.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/msm')
-rw-r--r-- | drivers/video/msm/mddi_client_nt35399.c | 7 | ||||
-rw-r--r-- | drivers/video/msm/mddi_client_toshiba.c | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c index f239f4a25e01..7fcd67e132bf 100644 --- a/drivers/video/msm/mddi_client_nt35399.c +++ b/drivers/video/msm/mddi_client_nt35399.c | |||
@@ -155,14 +155,10 @@ static int setup_vsync(struct panel_info *panel, int init) | |||
155 | ret = 0; | 155 | ret = 0; |
156 | goto uninit; | 156 | goto uninit; |
157 | } | 157 | } |
158 | ret = gpio_request(gpio, "vsync"); | 158 | ret = gpio_request_one(gpio, GPIOF_IN, "vsync"); |
159 | if (ret) | 159 | if (ret) |
160 | goto err_request_gpio_failed; | 160 | goto err_request_gpio_failed; |
161 | 161 | ||
162 | ret = gpio_direction_input(gpio); | ||
163 | if (ret) | ||
164 | goto err_gpio_direction_input_failed; | ||
165 | |||
166 | ret = irq = gpio_to_irq(gpio); | 162 | ret = irq = gpio_to_irq(gpio); |
167 | if (ret < 0) | 163 | if (ret < 0) |
168 | goto err_get_irq_num_failed; | 164 | goto err_get_irq_num_failed; |
@@ -180,7 +176,6 @@ uninit: | |||
180 | free_irq(gpio_to_irq(gpio), panel->client_data); | 176 | free_irq(gpio_to_irq(gpio), panel->client_data); |
181 | err_request_irq_failed: | 177 | err_request_irq_failed: |
182 | err_get_irq_num_failed: | 178 | err_get_irq_num_failed: |
183 | err_gpio_direction_input_failed: | ||
184 | gpio_free(gpio); | 179 | gpio_free(gpio); |
185 | err_request_gpio_failed: | 180 | err_request_gpio_failed: |
186 | return ret; | 181 | return ret; |
diff --git a/drivers/video/msm/mddi_client_toshiba.c b/drivers/video/msm/mddi_client_toshiba.c index f9bc932ac46b..053eb6877330 100644 --- a/drivers/video/msm/mddi_client_toshiba.c +++ b/drivers/video/msm/mddi_client_toshiba.c | |||
@@ -186,14 +186,10 @@ static int setup_vsync(struct panel_info *panel, | |||
186 | ret = 0; | 186 | ret = 0; |
187 | goto uninit; | 187 | goto uninit; |
188 | } | 188 | } |
189 | ret = gpio_request(gpio, "vsync"); | 189 | ret = gpio_request_one(gpio, GPIOF_IN, "vsync"); |
190 | if (ret) | 190 | if (ret) |
191 | goto err_request_gpio_failed; | 191 | goto err_request_gpio_failed; |
192 | 192 | ||
193 | ret = gpio_direction_input(gpio); | ||
194 | if (ret) | ||
195 | goto err_gpio_direction_input_failed; | ||
196 | |||
197 | ret = irq = gpio_to_irq(gpio); | 193 | ret = irq = gpio_to_irq(gpio); |
198 | if (ret < 0) | 194 | if (ret < 0) |
199 | goto err_get_irq_num_failed; | 195 | goto err_get_irq_num_failed; |
@@ -210,7 +206,6 @@ uninit: | |||
210 | free_irq(gpio_to_irq(gpio), panel); | 206 | free_irq(gpio_to_irq(gpio), panel); |
211 | err_request_irq_failed: | 207 | err_request_irq_failed: |
212 | err_get_irq_num_failed: | 208 | err_get_irq_num_failed: |
213 | err_gpio_direction_input_failed: | ||
214 | gpio_free(gpio); | 209 | gpio_free(gpio); |
215 | err_request_gpio_failed: | 210 | err_request_gpio_failed: |
216 | return ret; | 211 | return ret; |