pinctrl: pinctrl-single: fix pcs_pin_dbg_show() when bits_per_mux is not zero
authorHanna Hawa <hhhawa@amazon.com>
Fri, 19 Mar 2021 15:21:33 +0000 (17:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:30 +0000 (09:50 +0200)
commitda40d5fec5d70e5018523fc78243e5102d86731b
tree505a8a9c3f820ec11f9e9ceaad1e26ceae82f6de
parent353fcebf49e24e87e7634fec1ef21c75cb571396
pinctrl: pinctrl-single: fix pcs_pin_dbg_show() when bits_per_mux is not zero

[ Upstream commit bd85125ea88513f637a62a72e8949c579c5c0a87 ]

A System Error (SError, followed by kernel panic) was detected when
trying to print the supported pins in a pinctrl device which supports
multiple pins per register. This change fixes the pcs_pin_dbg_show() in
pinctrl-single driver when bits_per_mux is not zero. In addition move
offset calculation and pin offset in register to common function.

Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules")
Signed-off-by: Hanna Hawa <hhhawa@amazon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Drew Fustini <drew@beagleboard.org>
Link: https://lore.kernel.org/r/20210319152133.28705-4-hhhawa@amazon.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-single.c