Skip to contentSkip to conversation

gpio: mlxbf2.c: Add check for bgpio_init failure

PATCH Applied Asmaa Mnebhi 3 participants 3 messages Oct 22, 2021 – Oct 25, 2021 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: mlxbf2.c: Add check for bgpio_init failure

Add a check if bgpio_init fails.

---
 drivers/gpio/gpio-mlxbf2.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpio/gpio-mlxbf2.c +5 -0
index 177d03ef4529..40a052bc6784 100644
@@ -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;
Signature · 1 line
2.30.1
#1 lore raw
Quoted 25 lines · Asmaa Mnebhi

Add a check if bgpio_init fails.

---
 drivers/gpio/gpio-mlxbf2.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpio/gpio-mlxbf2.c +5 -1
index 177d03ef4529..40a052bc6784 100644
@@ -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;
--
Quoted 2 lines

2.30.1

Queued for fixes, thanks!

Bart

#2 lore raw
Quoted 1 line · Bartosz Golaszewski

On Fri, Oct 22, 2021 at 3:44 PM Asmaa Mnebhi <[email protected]> wrote:

A nit-pick that may be ignored...

Quoted 9 lines

drivers/gpio/gpio-mlxbf2.c mlxbf2_gpio_probe(struct platform_device *pdev) · line 263

Quoted 9 lines
                        NULL,
                        0);
drivers/gpio/gpio-mlxbf2.c +5 -0
+       if (ret) {
+               dev_err(dev, "bgpio_init failed\n");
+               return ret;
+       }
 
+

...can we utilize an empty line before if (ret) { instead?

Signature · 2 lines
With Best Regards,
Andy Shevchenko