2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 05:34:00 +08:00
linux-next/drivers/pinctrl/tegra
Laxman Dewangan b22ef2a097 pinctrl: tegra: Correctly check the supported configuration
The pincontrol registers of Tegra chips has multiple filed per
registers. There is two type of registers mux and drive. All
configurations belongs to one of these registers.

If any configurations are supported then <config>_bit is set to
bit position of these registers otherwise -1 to not support it.
The member is defined as
	s32 <config>_bit:6;

So if config is not supported ifor given SoC then it is set to -1
in soc pinmmux table.
In common driver code, to find out that given config is supported
or not, it is checked as:

s8 bit = <config>_bit;
if (bit > 31) {
	/* Not supported config */
}

But in this case, bit is s8 and hence for non supporting it is -1.

Correct the check as:
if (bit < 0) {
	/* Not supported config */
}

Fixes: e4c02dced9 ("pinctrl: tegra: use signed bitfields for optional fields")
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-05-11 11:22:57 +02:00
..
Kconfig pinctrl: tegra: move Tegra pinctrl drivers to sub-directory 2016-02-05 15:16:43 +01:00
Makefile pinctrl: tegra: move Tegra pinctrl drivers to sub-directory 2016-02-05 15:16:43 +01:00
pinctrl-tegra20.c pinctrl: tegra: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:28 +02:00
pinctrl-tegra30.c pinctrl: tegra: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:28 +02:00
pinctrl-tegra114.c pinctrl: tegra: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:28 +02:00
pinctrl-tegra124.c pinctrl: tegra: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:28 +02:00
pinctrl-tegra210.c pinctrl: tegra: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:28 +02:00
pinctrl-tegra-xusb.c pinctrl: tegra-xusb: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:32 +02:00
pinctrl-tegra.c pinctrl: tegra: Correctly check the supported configuration 2016-05-11 11:22:57 +02:00
pinctrl-tegra.h pinctrl: tegra: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:28 +02:00