summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorFranklin S Cooper Jr <fcooper@ti.com>2015-10-06 15:24:34 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-10-06 16:38:40 -0700
commit8b58cc36b11bafb9305db2417eab1eb47a212082 (patch)
tree366000edcc49878287f83c693963eab7823fdbf5 /drivers/input
parent5b21e3c740b770fb2548a5a8ea66e544d114d0a8 (diff)
downloadop-kernel-dev-8b58cc36b11bafb9305db2417eab1eb47a212082.zip
op-kernel-dev-8b58cc36b11bafb9305db2417eab1eb47a212082.tar.gz
Input: edt-ft5x06 - do not call desc_to_gpio for invalid gpios
Since reset and wake pin are optional the gpio structure for those pins may be null. Therefore, they can't be blindly passed to desc_to_gpio. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 7239c31..a8640c7 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -987,8 +987,9 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
dev_dbg(&client->dev,
"EDT FT5x06 initialized: IRQ %d, WAKE pin %d, Reset pin %d.\n",
- client->irq, desc_to_gpio(tsdata->wake_gpio),
- desc_to_gpio(tsdata->reset_gpio));
+ client->irq,
+ tsdata->wake_gpio ? desc_to_gpio(tsdata->wake_gpio) : -1,
+ tsdata->reset_gpio ? desc_to_gpio(tsdata->reset_gpio) : -1);
return 0;
OpenPOWER on IntegriCloud