Input: ads7846 - use PTR_ERR_OR_ZERO()
authorJavier Martinez Canillas <[email protected]>
Fri, 2 Oct 2015 18:20:40 +0000 (11:20 -0700)
committerDmitry Torokhov <[email protected]>
Fri, 2 Oct 2015 18:44:19 +0000 (11:44 -0700)
commitc4517f82d23eb72bf0768257bccc5f326c9ceada
tree71ff8ccfc6c7041aa07a8fc25a94b7a139f725d5
parente5e66ed00ea555a4f66793b4be84ff99c9c7fa6e
Input: ads7846 - 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/ads7846.c:532:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Signed-off-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/touchscreen/ads7846.c