mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02: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
|
|
@ -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
|
* The lock makes sure that either gpio-probe has completed
|
||||||
* or the gpio driver hasn't probed yet.
|
* or the gpio driver hasn't probed yet.
|
||||||
*/
|
*/
|
||||||
mutex_lock(&bank->deferred_lock);
|
scoped_guard(mutex, &bank->deferred_lock) {
|
||||||
if (!gpio || !gpio->direction_output) {
|
if (!gpio || !gpio->direction_output) {
|
||||||
rc = rockchip_pinconf_defer_pin(bank, pin - bank->pin_base, param,
|
rc = rockchip_pinconf_defer_pin(bank,
|
||||||
arg);
|
pin - bank->pin_base,
|
||||||
mutex_unlock(&bank->deferred_lock);
|
param, arg);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
mutex_unlock(&bank->deferred_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user