aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsmaa Mnebhi <asmaa@nvidia.com>2021-10-22 09:44:38 -0400
committerBartosz Golaszewski <brgl@bgdev.pl>2021-10-25 10:15:05 +0200
commitc0eee6fbfa2b3377f1efed10dad539abeb7312aa (patch)
treeeb830e3f39ab4d1304a18036b8ee5104e6375435
parent85fe6415c146d5d42ce300c12f1ecf4d4af47d40 (diff)
downloadlinux-c0eee6fbfa2b3377f1efed10dad539abeb7312aa.tar.gz
gpio: mlxbf2.c: Add check for bgpio_init failure
Add a check if bgpio_init fails. Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
-rw-r--r--drivers/gpio/gpio-mlxbf2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index 177d03ef45291c..40a052bc678498 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -256,6 +256,11 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
NULL,
0);
+ if (ret) {
+ dev_err(dev, "bgpio_init failed\n");
+ return ret;
+ }
+
gc->direction_input = mlxbf2_gpio_direction_input;
gc->direction_output = mlxbf2_gpio_direction_output;
gc->ngpio = npins;