mirror of
https://github.com/torvalds/linux.git
synced 2026-03-09 18:16:36 +01:00
pinctrl: rockchip: Simplify locking with scoped_guard()
Simplify error handling by removing two mutex_unlock() calls with scoped_guard(). Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
parent
160d686fbf
commit
e2c58cbe3a
1 changed files with 9 additions and 10 deletions
|
|
@ -3640,17 +3640,16 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
* The lock makes sure that either gpio-probe has completed
|
||||
* or the gpio driver hasn't probed yet.
|
||||
*/
|
||||
mutex_lock(&bank->deferred_lock);
|
||||
if (!gpio || !gpio->direction_output) {
|
||||
rc = rockchip_pinconf_defer_pin(bank, pin - bank->pin_base, param,
|
||||
arg);
|
||||
mutex_unlock(&bank->deferred_lock);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
break;
|
||||
scoped_guard(mutex, &bank->deferred_lock) {
|
||||
if (!gpio || !gpio->direction_output) {
|
||||
rc = rockchip_pinconf_defer_pin(bank,
|
||||
pin - bank->pin_base,
|
||||
param, arg);
|
||||
if (rc)
|
||||
return rc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&bank->deferred_lock);
|
||||
}
|
||||
|
||||
switch (param) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue