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 <jav...@osg.samsung.com>
---

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

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,
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to