]> www.infradead.org Git - users/willy/pagecache.git/commit
pinctrl: pinconf-generic: Print unsigned value if a format is registered
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Wed, 5 Feb 2025 10:10:58 +0000 (12:10 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 6 Feb 2025 09:13:15 +0000 (10:13 +0100)
commit0af4c120f5e7a1ea70aff7da2dfb65b6148a3e84
tree106f9b0dbfbfd284d0693e80c62e6e61a631742d
parent1ddee69108d305bbc059cbf31c0b47626796be77
pinctrl: pinconf-generic: Print unsigned value if a format is registered

Commit 3ba11e684d16 ("pinctrl: pinconf-generic: print hex value")
unconditionally switched to printing hex values in
pinconf_generic_dump_one(). However, if a dump format is registered for the
dumped pin, the hex value is printed as well. This hex value does not
necessarily correspond 1:1 with the hardware register value (as noted by
commit 3ba11e684d16 ("pinctrl: pinconf-generic: print hex value")). As a
result, user-facing output may include information like:
output drive strength (0x100 uA).

To address this, check if a dump format is registered for the dumped
property, and print the unsigned value instead when applicable.

Fixes: 3ba11e684d16 ("pinctrl: pinconf-generic: print hex value")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/20250205101058.2034860-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinconf-generic.c