Skip to content

Commit db2398a

Browse files
committed
Merge tag 'gpio-fixes-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski: - fix the return value check when parsing the ngpios property in gpio-xgs-iproc - check the return value of bgpio_init() in gpio-mlxbf2 * tag 'gpio-fixes-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mlxbf2.c: Add check for bgpio_init failure gpio: xgs-iproc: fix parsing of ngpios property
2 parents a379fbb + c0eee6f commit db2398a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/gpio/gpio-mlxbf2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
256256
NULL,
257257
0);
258258

259+
if (ret) {
260+
dev_err(dev, "bgpio_init failed\n");
261+
return ret;
262+
}
263+
259264
gc->direction_input = mlxbf2_gpio_direction_input;
260265
gc->direction_output = mlxbf2_gpio_direction_output;
261266
gc->ngpio = npins;

drivers/gpio/gpio-xgs-iproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
224224
}
225225

226226
chip->gc.label = dev_name(dev);
227-
if (of_property_read_u32(dn, "ngpios", &num_gpios))
227+
if (!of_property_read_u32(dn, "ngpios", &num_gpios))
228228
chip->gc.ngpio = num_gpios;
229229

230230
irq = platform_get_irq(pdev, 0);

0 commit comments

Comments
 (0)