[PATCH v3 12/12] gpio: rockchip: replace mutex_lock() with guard()

Andy Shevchenko andriy.shevchenko at linux.intel.com
Tue Sep 3 09:10:05 PDT 2024


On Tue, Sep 03, 2024 at 03:36:49PM +0800, Ye Zhang wrote:
> Replacing mutex_lock with guard() simplifies the code and helps avoid

mutex_lock()

avoiding

> deadlocks.

...

> --- a/drivers/gpio/gpio-rockchip.c
> +++ b/drivers/gpio/gpio-rockchip.c

+ cleanup.h

...

>  	}
> -	mutex_lock(&bank->deferred_lock);
> +	guard(mutex)(&bank->deferred_lock);

Make it surrounded by blank lines.

> +	ret = rockchip_get_bank_data(bank);
> +	if (ret)
> +		goto err_disabled_clk;

-- 
With Best Regards,
Andy Shevchenko





More information about the Linux-rockchip mailing list