diff options
author | Rob Herring <r.herring@freescale.com> | 2009-10-16 14:41:52 -0500 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2010-02-12 17:19:10 +0100 |
commit | 9b176b54963c6d2119ef11147aced07d4328820b (patch) | |
tree | d9ebd0f44f2eb517f5d9ed15b38fd8565d013597 /drivers/input | |
parent | b5ab92aa3c00e299dbab1ffcae5711686dc9508a (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.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index b512697b227d..fd5a503ffb93 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c @@ -266,6 +266,11 @@ static int tsc2007_probe(struct i2c_client *client, 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)); @@ -305,6 +310,8 @@ static int tsc2007_probe(struct i2c_client *client, free_irq(ts->irq, ts); err_free_mem: input_free_device(input_dev); + err_no_dev: + pdata->exit_platform_hw(); kfree(ts); return err; } |