aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2021-03-12 08:04:23 +0000
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2021-03-12 11:55:20 +0100
commit3875721e825cf3ab05fc1a52b6cbd76c8d16da51 (patch)
treea7c487152abb1821da4fce18130a496896484cbc /drivers/gpio
parentgpiolib: Read "gpio-line-names" from a firmware node (diff)
downloadlinux-dev-3875721e825cf3ab05fc1a52b6cbd76c8d16da51.tar.xz
linux-dev-3875721e825cf3ab05fc1a52b6cbd76c8d16da51.zip
gpiolib: Fix error return code in gpiolib_dev_init()
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 <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 7ec0822c0505..6635e4ec60ce 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4256,7 +4256,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;