Skip to contentSkip to conversation

gpio: qixis-fpga: Fix a NULL vs IS_ERR() bug in probe()

PATCH Applied Dan Carpenter 3 participants 3 messages Oct 24, 2025 – Oct 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: qixis-fpga: Fix a NULL vs IS_ERR() bug in probe()

The devm_platform_ioremap_resource() function doesn't return NULL, it returns error pointers. Fix the checking to match.

Fixes e88500247dc3 ("gpio: add QIXIS FPGA GPIO controller")
---
 drivers/gpio/gpio-qixis-fpga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-qixis-fpga.c +2 -2
index 54c2c76822d5..6e67f43ac0bd 100644
@@ -56,8 +56,8 @@ static int qixis_cpld_gpio_probe(struct platform_device *pdev)
 		 * create our own from the MMIO space.
 		 */
 		reg = devm_platform_ioremap_resource(pdev, 0);
-		if (!reg)
-			return -ENODEV;
+		if (IS_ERR(reg))
+			return PTR_ERR(reg);
 
 		regmap = devm_regmap_init_mmio(&pdev->dev, reg, &regmap_config_8r_8v);
 		if (!regmap)
Signature · 1 line
2.51.0
#2 lore raw
In reply to Dan Carpenter

From: Bartosz Golaszewski <[email protected]>

Quoted 4 lines · Dan Carpenter

The devm_platform_ioremap_resource() function doesn't return NULL, it returns error pointers. Fix the checking to match.

Applied, thanks!

[1/1] gpio: qixis-fpga: Fix a NULL vs IS_ERR() bug in probe()

      https://git.kernel.org/brgl/linux/c/9452252dff94ff2cbcd33d3418c2b95ff74bdba5

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>