@@ -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,
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(-)