pinctrl: stm32: fix error path when gpio chip is not found
Current error path has two issues:

- PTR_ERR is applied to a NULL pointer, so even error conditions return
  zero, which is a valid successful return.
- The return value is stored into an unsigned integer which is checked
  to be less than zero, so the error is never handled.

Fix both issues.

Fixes: f4f933a64 ("pinctrl: add driver for STM32 GPIO and pin multiplexer")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 3cad56f commit bd7014fc490e8ca56dc9d418b07f5b9dbc65283d
@Ahmad Fatoum Ahmad Fatoum authored on 8 Jul 2019
Sascha Hauer committed on 9 Jul 2019
Showing 1 changed file
View
drivers/pinctrl/pinctrl-stm32.c