diff options
| author | Drew Fustini <dfustini@tenstorrent.com> | 2024-10-08 18:16:47 -0700 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2024-10-09 14:42:07 +0200 |
| commit | f3a3d006a443e3e39f97b4e71a8d134cda417109 (patch) | |
| tree | 8800ce5a5261049d8adee9c6ca8a8664909b9ad0 | |
| parent | 7027e36f55f663c2248e8a2d67b94e34cab0ac7f (diff) | |
pinctrl: th1520: Convert thp->mutex to guarded mutex
Convert th1520_pinctrl_dt_node_to_map() to use guarded mutex for
thp->mutex.
Suggested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Drew Fustini <dfustini@tenstorrent.com>
Link: https://lore.kernel.org/20241008-th1520-pinctrl-fixes-v3-2-5b60db446a49@tenstorrent.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| -rw-r--r-- | drivers/pinctrl/pinctrl-th1520.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-th1520.c b/drivers/pinctrl/pinctrl-th1520.c index 265a75a78d5a..7ed3f82b9339 100644 --- a/drivers/pinctrl/pinctrl-th1520.c +++ b/drivers/pinctrl/pinctrl-th1520.c @@ -444,7 +444,7 @@ static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, return -ENOMEM; nmaps = 0; - mutex_lock(&thp->mutex); + guard(mutex)(&thp->mutex); for_each_available_child_of_node(np, child) { unsigned int rollback = nmaps; enum th1520_muxtype muxtype; @@ -531,7 +531,6 @@ static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, *maps = map; *num_maps = nmaps; - mutex_unlock(&thp->mutex); return 0; free_configs: @@ -539,7 +538,6 @@ free_configs: put_child: of_node_put(child); th1520_pinctrl_dt_free_map(pctldev, map, nmaps); - mutex_unlock(&thp->mutex); return ret; } |
