summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorRob Herring <r.herring@freescale.com>2009-10-16 14:41:52 -0500
committerFrank Li <Frank.Li@freescale.com>2011-04-01 11:33:18 +0800
commitdf02bd534a51bf62f5b61352a849bba33fb3c53e (patch)
tree80949ce6f588538e2d37f5eefe1e8975325cd4c5 /drivers/input
parentd3ed255dce9bfcd59ebc5abe244d9409e1e2ee9e (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 80467f262331..91baff72c251 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -295,6 +295,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));
@@ -338,6 +345,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;
}