805-03-v6.10-pinctrl-aw9523-Destroy-mutex-on-remove.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From e5e8a58023707472e5dbe9bc7b473a8703b401e0 Mon Sep 17 00:00:00 2001
  2. From: Andy Shevchenko <[email protected]>
  3. Date: Fri, 29 Mar 2024 12:55:15 +0200
  4. Subject: [PATCH] pinctrl: aw9523: Destroy mutex on ->remove()
  5. If aw9523_hw_init() fails on ->remove() the mutex left alive.
  6. Destroy it in that case as well. While at it, remove never
  7. true check at the beginning of the function.
  8. Signed-off-by: Andy Shevchenko <[email protected]>
  9. Message-ID: <[email protected]>
  10. Signed-off-by: Linus Walleij <[email protected]>
  11. ---
  12. drivers/pinctrl/pinctrl-aw9523.c | 8 +-------
  13. 1 file changed, 1 insertion(+), 7 deletions(-)
  14. --- a/drivers/pinctrl/pinctrl-aw9523.c
  15. +++ b/drivers/pinctrl/pinctrl-aw9523.c
  16. @@ -1067,10 +1067,6 @@ err_disable_vregs:
  17. static void aw9523_remove(struct i2c_client *client)
  18. {
  19. struct aw9523 *awi = i2c_get_clientdata(client);
  20. - int ret;
  21. -
  22. - if (!awi)
  23. - return;
  24. /*
  25. * If the chip VIO is connected to a regulator that we can turn
  26. @@ -1082,10 +1078,8 @@ static void aw9523_remove(struct i2c_cli
  27. regulator_disable(awi->vio_vreg);
  28. } else {
  29. mutex_lock(&awi->i2c_lock);
  30. - ret = aw9523_hw_init(awi);
  31. + aw9523_hw_init(awi);
  32. mutex_unlock(&awi->i2c_lock);
  33. - if (ret)
  34. - return;
  35. }
  36. mutex_destroy(&awi->i2c_lock);