[PATCH v3 1/2] i2c: imx: use guard to take spinlock
Oleksij Rempel
o.rempel at pengutronix.de
Thu May 29 23:06:41 PDT 2025
On Tue, May 13, 2025 at 02:36:13PM +0800, Troy Mitchell wrote:
> Use guard to automatically release the lock after going out of scope
> instead of calling it manually.
>
> i2c_imx_slave_handle() can safely be entered with the lock held.
>
> Refactored the i2c_imx_isr function so that i2c_imx_master_isr
> does not participate in the guard scope
>
> So Using scoped_guard simplifies the control flow
> by ensuring consistent and automatic unlock,
> which improves readability without affecting correctness.
>
> Co-developed-by: Yongchao Jia <jyc0019 at gmail.com>
> Signed-off-by: Yongchao Jia <jyc0019 at gmail.com>
> Reviewed-by: Frank Li <Frank.Li at nxp.com>
> Signed-off-by: Troy Mitchell <troymitchell988 at gmail.com>
Acked-by: Oleksij Rempel <o.rempel at pengutronix.de>
Thank you!
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the linux-arm-kernel
mailing list