diff mbox

[v3,1/2] ads7846: fix gpio free without requesting

Message ID 1296746486-12168-1-git-send-email-sourav.poddar@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Poddar, Sourav Feb. 3, 2011, 3:21 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 14ea54b..ce5baee 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -952,6 +952,7 @@  static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
 
 	if (pdata->get_pendown_state) {
 		ts->get_pendown_state = pdata->get_pendown_state;
+		ts->gpio_pendown = -EINVAL;
 		return 0;
 	}
 
@@ -1353,7 +1354,7 @@  static int __devinit ads7846_probe(struct spi_device *spi)
  err_put_regulator:
 	regulator_put(ts->reg);
  err_free_gpio:
-	if (ts->gpio_pendown != -1)
+	if (gpio_is_valid(ts->gpio_pendown))
 		gpio_free(ts->gpio_pendown);
  err_cleanup_filter:
 	if (ts->filter_cleanup)