diff mbox

[12/18] Input: pxa27x_keypad - simplify function return logic

Message ID 1443793229-22363-13-git-send-email-javier@osg.samsung.com (mailing list archive)
State Rejected
Headers show

Commit Message

Javier Martinez Canillas Oct. 2, 2015, 1:40 p.m. UTC
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/keyboard/pxa27x_keypad.c:141:1-6: WARNING: end returns can be simplified

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/input/keyboard/pxa27x_keypad.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index fcef5d1365e2..436e8c2efbe5 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -138,14 +138,10 @@  static int pxa27x_keypad_matrix_key_parse_dt(struct pxa27x_keypad *keypad,
 	pdata->matrix_key_rows = rows;
 	pdata->matrix_key_cols = cols;
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
-					   pdata->matrix_key_rows,
-					   pdata->matrix_key_cols,
-					   keypad->keycodes, input_dev);
-	if (error)
-		return error;
-
-	return 0;
+	return matrix_keypad_build_keymap(NULL, NULL,
+					  pdata->matrix_key_rows,
+					  pdata->matrix_key_cols,
+					  keypad->keycodes, input_dev);
 }
 
 static int pxa27x_keypad_direct_key_parse_dt(struct pxa27x_keypad *keypad,