summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ad7879-i2c.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-02-28 20:43:52 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-01 18:42:44 +0100
commit4e34025b340174e220646d82a3e81641fc02f42b (patch)
treee3d96d4b85a7003be8e01f36b18371e253fcc5db /drivers/input/touchscreen/ad7879-i2c.c
parentInput: ad7879 - make sure we set up drvdata (diff)
downloadlinux-4e34025b340174e220646d82a3e81641fc02f42b.tar.xz
linux-4e34025b340174e220646d82a3e81641fc02f42b.zip
Input: ad7879 - return plain error code from ad7879_probe()
With the switch to devm, there is no need for ad7879_probe() to return the touchscreen structure, we can use plain error code. This also fixes issue introduced with devm concersion, where we returned 0 on success (which worked OK since IS_ERR(0) would not trigger, but was not correct regardless). Fixes: 381f688eee3d ("Input: ad7879 - use more devm interfaces") Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/ad7879-i2c.c')
-rw-r--r--drivers/input/touchscreen/ad7879-i2c.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c
index a282d1c9e2c6..49b902b10c5f 100644
--- a/drivers/input/touchscreen/ad7879-i2c.c
+++ b/drivers/input/touchscreen/ad7879-i2c.c
@@ -27,7 +27,6 @@ static const struct regmap_config ad7879_i2c_regmap_config = {
static int ad7879_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
- struct ad7879 *ts;
struct regmap *regmap;
if (!i2c_check_functionality(client->adapter,
@@ -40,12 +39,8 @@ static int ad7879_i2c_probe(struct i2c_client *client,
if (IS_ERR(regmap))
return PTR_ERR(regmap);
- ts = ad7879_probe(&client->dev, regmap, client->irq,
- BUS_I2C, AD7879_DEVID);
- if (IS_ERR(ts))
- return PTR_ERR(ts);
-
- return 0;
+ return ad7879_probe(&client->dev, regmap, client->irq,
+ BUS_I2C, AD7879_DEVID);
}
static const struct i2c_device_id ad7879_id[] = {