Return an error on probe if i2c errors occur indicating the device
is not present.
Signed-off-by: Rob Herring <r.herring@freescale.com>
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));
pdata->exit_platform_hw();
err_free_mem:
input_free_device(input_dev);
+ err_no_dev:
+ pdata->exit_platform_hw();
kfree(ts);
return err;
}