Commit a5c627d9 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: adnp: fix flow control regression caused by scoped_guard()



scoped_guard() is implemented as a for loop. Using it to protect code
using the continue statement changes the flow as we now only break out
of the hidden loop inside scoped_guard(), not the original for loop. Use
a regular code block instead.

Fixes: c7fe19ed ("gpio: adnp: use lock guards for the I2C lock")
Reported-by: default avatarDavid Lechner <dlechner@baylibre.com>
Closes: https://lore.kernel.org/all/cde2abb2-4cc8-4fc9-b34a-0c5d2b95779f@baylibre.com/


Reviewed-by: default avatarLinus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260522073527.9812-1-bartosz.golaszewski@oss.qualcomm.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
parent bbec30f7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -237,7 +237,9 @@ static irqreturn_t adnp_irq(int irq, void *data)
		unsigned long pending;
		int err;

		scoped_guard(mutex, &adnp->i2c_lock) {
		{
			guard(mutex)(&adnp->i2c_lock);

			err = adnp_read(adnp, GPIO_PLR(adnp) + i, &level);
			if (err < 0)
				continue;