]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm64: a37xx: pinctrl: fix info->dev used but never set
authorQuentin Schulz <quentin.schulz@cherry.de>
Thu, 25 Jun 2026 09:45:52 +0000 (11:45 +0200)
committerStefan Roese <stefan.roese@mailbox.org>
Thu, 30 Jul 2026 19:04:16 +0000 (21:04 +0200)
A bunch of code calls info->dev, mostly dev_* messages and devm_kzalloc.

The former can be passed a NULL device and _dev_printk handles this just
fine.
The latter ignores the dev argument whenever !CONFIG_IS_ENABLED(DEVRES)
which was true in most cases until we made CONFIG_DEVRES mandatory for
U-Boot proper in commit 217cf656e249 ("dm: core: Default to using DEVRES
outside of xPL"). Failing to set info->dev before it's used by
devm_kzalloc results in crashes, therefore let's set info->dev before it
can be used.

Reported-by: Ben Schneider <ben@bens.haus>
Closes: https://lore.kernel.org/u-boot/IRefanijM8fTzOXeGe-H5hmhRkm7pt4Q83BV6VcWKlWp0s4i8mYcONTQz-IVhvNWlGta4LtnfK7ti6gxlrqq8h8cotgG1S0Fs6_DviAHvyo=@bens.haus/
Fixes: 0871806629b5 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx")
Fixes: 217cf656e249 ("dm: core: Default to using DEVRES outside of xPL")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Tested-by: Ben Schneider <ben@bens.haus>
Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

index 884ed258d1780099692cd85365d664f8f46fcc05..ea726b96f61617724990dec4290614f72156c233 100644 (file)
@@ -720,6 +720,8 @@ static int armada_37xx_pinctrl_probe(struct udevice *dev)
                return -ENODEV;
        }
 
+       info->dev = dev;
+
        /*
         * we allocate functions for number of pins and hope there are
         * fewer unique functions than pins available