]> asedeno.scripts.mit.edu Git - linux.git/commit
pinctrl: sunxi: Make sunxi_pconf_group_set use sunxi_pconf_reg helper
authorChen-Yu Tsai <wens@csie.org>
Fri, 11 Nov 2016 09:50:36 +0000 (17:50 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 15 Nov 2016 09:21:49 +0000 (10:21 +0100)
commit51814827190214986c452a166718bf12d32211c7
tree2e0097e0d01f4d98c4cc4a82a1d6c2aec8d02e39
parentc5fda170e87a4bdaeb278f7e50f7a1f654e94eb5
pinctrl: sunxi: Make sunxi_pconf_group_set use sunxi_pconf_reg helper

The sunxi_pconf_reg helper introduced in the last patch gives us the
chance to rework sunxi_pconf_group_set to have it match the structure
of sunxi_pconf_(group_)get and make it easier to understand.

For each config to set, it:

    1. checks if the parameter is supported.
    2. checks if the argument is within limits.
    3. converts argument to the register value.
    4. writes to the register with spinlock held.

As a result the function now blocks unsupported config parameters,
instead of silently ignoring them.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sunxi/pinctrl-sunxi.c