Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: tps6507x-ts - simplify function return logic

The invoked function already returns zero on success or a negative
errno code so there is no need to open code the logic in the caller.

This also fixes the following make coccicheck warning:

drivers/input/touchscreen/tps6507x-ts.c:57:5-8: WARNING: end returns can be simplified

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Javier Martinez Canillas and committed by
Dmitry Torokhov
e5e66ed0 901ea5e3

+1 -8
+1 -8
drivers/input/touchscreen/tps6507x-ts.c
··· 50 50 51 51 static int tps6507x_read_u8(struct tps6507x_ts *tsc, u8 reg, u8 *data) 52 52 { 53 - int err; 54 - 55 - err = tsc->mfd->read_dev(tsc->mfd, reg, 1, data); 56 - 57 - if (err) 58 - return err; 59 - 60 - return 0; 53 + return tsc->mfd->read_dev(tsc->mfd, reg, 1, data); 61 54 } 62 55 63 56 static int tps6507x_write_u8(struct tps6507x_ts *tsc, u8 reg, u8 data)