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/omap2/displays/panel-tpo-td043mtea1.c | |
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/omap2/displays/panel-tpo-td043mtea1.c')
-rw-r--r-- | drivers/video/omap2/displays/panel-tpo-td043mtea1.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index e6649aa89591..880c313d6bcc 100644 --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c | |||
@@ -408,17 +408,12 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) | |||
408 | } | 408 | } |
409 | 409 | ||
410 | if (gpio_is_valid(nreset_gpio)) { | 410 | if (gpio_is_valid(nreset_gpio)) { |
411 | ret = gpio_request(nreset_gpio, "lcd reset"); | 411 | ret = gpio_request_one(nreset_gpio, GPIOF_OUT_INIT_LOW, |
412 | "lcd reset"); | ||
412 | if (ret < 0) { | 413 | if (ret < 0) { |
413 | dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); | 414 | dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); |
414 | goto fail_gpio_req; | 415 | goto fail_gpio_req; |
415 | } | 416 | } |
416 | |||
417 | ret = gpio_direction_output(nreset_gpio, 0); | ||
418 | if (ret < 0) { | ||
419 | dev_err(&dssdev->dev, "couldn't set GPIO direction\n"); | ||
420 | goto fail_gpio_direction; | ||
421 | } | ||
422 | } | 417 | } |
423 | 418 | ||
424 | ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group); | 419 | ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group); |
@@ -427,8 +422,6 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) | |||
427 | 422 | ||
428 | return 0; | 423 | return 0; |
429 | 424 | ||
430 | fail_gpio_direction: | ||
431 | gpio_free(nreset_gpio); | ||
432 | fail_gpio_req: | 425 | fail_gpio_req: |
433 | regulator_put(tpo_td043->vcc_reg); | 426 | regulator_put(tpo_td043->vcc_reg); |
434 | fail_regulator: | 427 | fail_regulator: |