2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-12 15:44:01 +08:00

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>
This commit is contained in:
Franklin S Cooper Jr 2015-10-06 15:24:34 -07:00 committed by Dmitry Torokhov
parent 5b21e3c740
commit 8b58cc36b1

View File

@ -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;