diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2024-03-29 12:55:15 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2024-04-04 13:16:45 +0200 |
commit | e5e8a58023707472e5dbe9bc7b473a8703b401e0 (patch) | |
tree | 44ab521411d408f6a652361b9768e74aab09738e /drivers/pinctrl | |
parent | d303735ce5dcd79783e65a3710f7f16d14f8900a (diff) | |
download | linux-e5e8a58023707472e5dbe9bc7b473a8703b401e0.tar.gz linux-e5e8a58023707472e5dbe9bc7b473a8703b401e0.tar.bz2 linux-e5e8a58023707472e5dbe9bc7b473a8703b401e0.zip |
pinctrl: aw9523: Destroy mutex on ->remove()
If aw9523_hw_init() fails on ->remove() the mutex left alive.
Destroy it in that case as well. While at it, remove never
true check at the beginning of the function.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-2-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-aw9523.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9523.c index 4edd371c469f..66629af0b88b 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -1067,10 +1067,6 @@ err_disable_vregs: static void aw9523_remove(struct i2c_client *client) { struct aw9523 *awi = i2c_get_clientdata(client); - int ret; - - if (!awi) - return; /* * If the chip VIO is connected to a regulator that we can turn @@ -1082,10 +1078,8 @@ static void aw9523_remove(struct i2c_client *client) regulator_disable(awi->vio_vreg); } else { mutex_lock(&awi->i2c_lock); - ret = aw9523_hw_init(awi); + aw9523_hw_init(awi); mutex_unlock(&awi->i2c_lock); - if (ret) - return; } mutex_destroy(&awi->i2c_lock); |