diff options
author | Javier Martinez Canillas <javier@osg.samsung.com> | 2015-10-02 20:21:12 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-10-02 20:44:19 +0200 |
commit | d6f0c3d3a815aca40f1ea9daf6ed0d1f9e243185 (patch) | |
tree | c48b040487faf5ff535aa26937793610cdf40ade | |
parent | Input: ads7846 - use PTR_ERR_OR_ZERO() (diff) | |
download | linux-d6f0c3d3a815aca40f1ea9daf6ed0d1f9e243185.tar.xz linux-d6f0c3d3a815aca40f1ea9daf6ed0d1f9e243185.zip |
Input: cyttsp - use PTR_ERR_OR_ZERO()
The PTR_ERR_OR_ZERO() helper function checks if a pointer contains an
errno code and returns it or return 0 if that's not the case. Use the
helper instead of open coding the same logic in the driver. This was
found with make coccicheck that complains with the following warning:
drivers/input/touchscreen/cyttsp4_i2c.c:53:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/cyttsp4_i2c.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/cyttsp4_i2c.c b/drivers/input/touchscreen/cyttsp4_i2c.c index a9f95c7d3c00..564e49002d5d 100644 --- a/drivers/input/touchscreen/cyttsp4_i2c.c +++ b/drivers/input/touchscreen/cyttsp4_i2c.c @@ -50,10 +50,7 @@ static int cyttsp4_i2c_probe(struct i2c_client *client, ts = cyttsp4_probe(&cyttsp4_i2c_bus_ops, &client->dev, client->irq, CYTTSP4_I2C_DATA_SIZE); - if (IS_ERR(ts)) - return PTR_ERR(ts); - - return 0; + return PTR_ERR_OR_ZERO(ts); } static int cyttsp4_i2c_remove(struct i2c_client *client) |