summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2026-08-03 15:35:35 -0700
committerMadhavan Srinivasan <maddy@linux.ibm.com>2026-08-09 20:25:39 +0530
commit8ab2d98f635f77132c9fca4e3983c53729ef52cf (patch)
tree4411a6a302cb2649aacc90571ac58695d2afafbc /drivers/gpio
parentf17b0ef8593d2c9f38197c396146b63e918e46fc (diff)
downloadlinux-next-8ab2d98f635f77132c9fca4e3983c53729ef52cf.tar.gz
linux-next-8ab2d98f635f77132c9fca4e3983c53729ef52cf.zip
gpio: ppc44x: Use platform resource helper for GPIO MMIO
Map the PPC44x GPIO register block through the platform device resource instead of reparsing the firmware node directly. The GPIO node now probes as a platform device, so use the platform helper to keep resource handling aligned with the converted driver model and to report mapping failures with the platform device context. Move ioremap up in order to avoid doing extra work in case of -EPROBE_DEFER. Assisted-by: Codex:GPT-5.5 Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260803223539.86303-5-rosenp@gmail.com
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-ppc44x.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-ppc44x.c b/drivers/gpio/gpio-ppc44x.c
index 99fb11cd7966..5db5217c0225 100644
--- a/drivers/gpio/gpio-ppc44x.c
+++ b/drivers/gpio/gpio-ppc44x.c
@@ -158,13 +158,20 @@ static int ppc44x_gpio_probe(struct platform_device *ofdev)
{
struct device *dev = &ofdev->dev;
struct device_node *np = dev->of_node;
+ struct ppc44x_gpio __iomem *regs;
struct ppc44x_gpio_chip *chip;
struct gpio_chip *gc;
+ regs = devm_platform_ioremap_resource(ofdev, 0);
+ if (IS_ERR(regs))
+ return PTR_ERR(regs);
+
chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
+ chip->regs = regs;
+
spin_lock_init(&chip->lock);
gc = &chip->gc;
@@ -181,10 +188,6 @@ static int ppc44x_gpio_probe(struct platform_device *ofdev)
if (!gc->label)
return -ENOMEM;
- chip->regs = devm_of_iomap(dev, np, 0, NULL);
- if (IS_ERR(chip->regs))
- return PTR_ERR(chip->regs);
-
return devm_gpiochip_add_data(dev, gc, chip);
}