summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorRob Herring <r.herring@freescale.com>2009-10-16 14:41:52 -0500
committerJason Liu <r64343@freescale.com>2012-01-09 19:53:38 +0800
commit2ad1a06e51fb4d8872c1ec8b2dfc9387398c9727 (patch)
tree882fadcbb4b14696eae3b6ccfa07fb357e4ce4f2 /drivers/input
parent45b4d077a016b26e262445b783812d845fc57930 (diff)
tsc2007: fail registration on i2c error
Return an error on probe if i2c errors occur indicating the device is not present. Signed-off-by: Rob Herring <r.herring@freescale.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/tsc2007.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index fadc11545b1e..da7432726c99 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -300,6 +300,13 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
ts->get_pendown_state = pdata->get_pendown_state;
ts->clear_penirq = pdata->clear_penirq;
+ pdata->init_platform_hw();
+
+ if (tsc2007_xfer(ts, PWRDOWN) < 0) {
+ err = -ENODEV;
+ goto err_no_dev;
+ }
+
snprintf(ts->phys, sizeof(ts->phys),
"%s/input0", dev_name(&client->dev));
@@ -344,6 +351,8 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
pdata->exit_platform_hw();
err_free_mem:
input_free_device(input_dev);
+ err_no_dev:
+ pdata->exit_platform_hw();
kfree(ts);
return err;
}