mbox series

[0/3] pwm: Use guards instead of explicity mutex_lock + mutex_unlock

Message ID cover.1719520143.git.u.kleine-koenig@baylibre.com
Headers show
Series pwm: Use guards instead of explicity mutex_lock + mutex_unlock | expand

Message

Uwe Kleine-König June 27, 2024, 8:31 p.m. UTC
Hello,

I consider this a nice cleanup. It makes the code more compact and it's less
prone to error, because you cannot forget an unlock in an error path.

Best regards
Uwe

Uwe Kleine-König (3):
  pwm: Use guards for pwm_lock instead of explicity mutex_lock + mutex_unlock
  pwm: Use guards for export->lock instead of explicity mutex_lock + mutex_unlock
  pwm: Use guards for pwm_lookup_lock instead of explicity mutex_lock + mutex_unlock

 drivers/pwm/core.c | 128 +++++++++++++++++----------------------------
 1 file changed, 48 insertions(+), 80 deletions(-)

base-commit: 888564d8d708d1c91900ed3a11761f46297fd748

Comments

Uwe Kleine-König July 5, 2024, 10:24 a.m. UTC | #1
Hello,

On Thu, Jun 27, 2024 at 10:31:18PM +0200, Uwe Kleine-König wrote:
> I consider this a nice cleanup. It makes the code more compact and it's less
> prone to error, because you cannot forget an unlock in an error path.
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (3):
>   pwm: Use guards for pwm_lock instead of explicity mutex_lock + mutex_unlock
>   pwm: Use guards for export->lock instead of explicity mutex_lock + mutex_unlock
>   pwm: Use guards for pwm_lookup_lock instead of explicity mutex_lock + mutex_unlock

I applied the series to my pwm/for-next branch.

Best regards
Uwe