pinctrl: create pinctrl_free_setting function
This prepares the implementation of pinctrl_select_state_locked() free code. No functionnal change. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Родитель
2c9abf808a
Коммит
d3cee8305b
|
@ -794,16 +794,12 @@ struct pinctrl *pinctrl_get(struct device *dev)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_get);
|
||||
|
||||
static void pinctrl_put_locked(struct pinctrl *p, bool inlist)
|
||||
static void pinctrl_free_setting(bool disable_setting,
|
||||
struct pinctrl_setting *setting)
|
||||
{
|
||||
struct pinctrl_state *state, *n1;
|
||||
struct pinctrl_setting *setting, *n2;
|
||||
|
||||
list_for_each_entry_safe(state, n1, &p->states, node) {
|
||||
list_for_each_entry_safe(setting, n2, &state->settings, node) {
|
||||
switch (setting->type) {
|
||||
case PIN_MAP_TYPE_MUX_GROUP:
|
||||
if (state == p->state)
|
||||
if (disable_setting)
|
||||
pinmux_disable_setting(setting);
|
||||
pinmux_free_setting(setting);
|
||||
break;
|
||||
|
@ -814,6 +810,16 @@ static void pinctrl_put_locked(struct pinctrl *p, bool inlist)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void pinctrl_put_locked(struct pinctrl *p, bool inlist)
|
||||
{
|
||||
struct pinctrl_state *state, *n1;
|
||||
struct pinctrl_setting *setting, *n2;
|
||||
|
||||
list_for_each_entry_safe(state, n1, &p->states, node) {
|
||||
list_for_each_entry_safe(setting, n2, &state->settings, node) {
|
||||
pinctrl_free_setting(state == p->state, setting);
|
||||
list_del(&setting->node);
|
||||
kfree(setting);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче