gpiolib: Fix error return code in gpiolib_dev_init()
Subsystems (2)
PATCH 1/1 gpiolib: Fix error return code in gpiolib_dev_init()
From: Wei Yongjun <[email protected]>
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/gpio/gpiolib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +2 -1
@@ -4242,7 +4242,8 @@ static int __init gpiolib_dev_init(void)return ret; } -if (driver_register (&gpio_stub_drv) <0 ) { + ret =driver_register (&gpio_stub_drv); +if (ret <0 ) {pr_err ("gpiolib: could not register GPIO stub driver\n" );bus_unregister (&gpio_bus_type);return ret;
Bartosz Golaszewski
AppliedQuoted 19 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>--- drivers/gpio/gpiolib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpio/gpiolib.c +0
-0
drivers/gpio/gpiolib.c static int __init gpiolib_dev_init(void) · line 4249
Quoted 9 lines
drivers/gpio/gpiolib.c +2
-1@@ -4242,7 +4242,8 @@ static int __init gpiolib_dev_init(void)return ret; } -if (driver_register (&gpio_stub_drv) <0 ) { + ret =driver_register (&gpio_stub_drv); +if (ret <0 ) {pr_err ("gpiolib: could not register GPIO stub driver\n" );bus_unregister (&gpio_bus_type);return ret;
Applied to fixes, thanks!
Bartosz