pinctrl: single: Fix group and function selector use
authorTony Lindgren <tony@atomide.com>
Thu, 5 Jul 2018 09:10:16 +0000 (02:10 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 17 Jul 2018 08:49:10 +0000 (10:49 +0200)
commita4ab1086072365235864151bca57230afa8bcc93
tree58fe55dd8f4b02cb46957867478e6afae06b6839
parentf913cfce4ee49a3382a9ff95696f49a46e56e974
pinctrl: single: Fix group and function selector use

We must use a mutex around the generic_add functions and save the
function and group selector in case we need to remove them. Otherwise
the selector use will be racy for deferred probe at least.

Note that struct device_node *np is unused in pcs_add_function() we
remove that too and fix a checkpatch warning for bare unsigned while
at it.

Fixes: 571aec4df5b7 ("pinctrl: single: Use generic pinmux helpers for
managing functions")
Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Christ van Willegen <cvwillegen@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-By: H. Nikolaus Schaller <hns@goldelico.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-single.c