Skip to contentSkip to conversation

iio: dac: ad5592r: Delete stray unlock in ad5592r_write_raw()

PATCH Applied Dan Carpenter 5 participants 5 messages Apr 16, 2025 – Apr 18, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: dac: ad5592r: Delete stray unlock in ad5592r_write_raw()

This code was converted to use guard locks but one of the unlocks was accidentally overlooked. Delete it.

Fixes f8fedb167ba4 ("iio: dac: ad5592r: use lock guards")
---
 drivers/iio/dac/ad5592r-base.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ad5592r-base.c +1 -3
index 217a8a88818d..5f2cd51723f6 100644
@@ -324,10 +324,8 @@ static int ad5592r_write_raw(struct iio_dev *iio_dev,
 
 			ret = st->ops->reg_read(st, AD5592R_REG_CTRL,
 						&st->cached_gp_ctrl);
-			if (ret < 0) {
-				mutex_unlock(&st->lock);
+			if (ret < 0)
 				return ret;
-			}
 
 			if (chan->output) {
 				if (gain)
Signature · 1 line
2.47.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Dan Carpenter

This code was converted to use guard locks but one of the unlocks was accidentally overlooked. Delete it.

Yeah, looks like missed one.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 6 lines · Dan Carpenter

This code was converted to use guard locks but one of the unlocks was accidentally overlooked.  Delete it.

Fixes f8fedb167ba4 ("iio: dac: ad5592r: use lock guards")

---

Thx!
- Nuno Sá

Quoted 19 lines

 drivers/iio/dac/ad5592r-base.c | 4 +---

 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ad5592r-base.c +0 -0
index 217a8a88818d..5f2cd51723f6 100644
@@ -324,10 +324,8 @@ static int ad5592r_write_raw(struct iio_dev *iio_dev,


  ret = st->ops->reg_read(st, AD5592R_REG_CTRL, &st->cached_gp_ctrl);

drivers/iio/dac/ad5592r-base.c +1 -2
-			if (ret < 0) {
-				mutex_unlock(&st->lock);
+			if (ret < 0)

  return ret;

drivers/iio/dac/ad5592r-base.c +0 -1
-			}


  if (chan->output) {
  if (gain)

Reviewed-by on v1 1/1
#3 lore raw
In reply to Dan Carpenter
Quoted 27 lines · Dan Carpenter

This code was converted to use guard locks but one of the unlocks was accidentally overlooked. Delete it.

Fixes f8fedb167ba4 ("iio: dac: ad5592r: use lock guards")
---
 drivers/iio/dac/ad5592r-base.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ad5592r-base.c +1 -4
index 217a8a88818d..5f2cd51723f6 100644
@@ -324,10 +324,8 @@ static int ad5592r_write_raw(struct iio_dev *iio_dev,
 
                        ret = st->ops->reg_read(st, AD5592R_REG_CTRL,
                                                &st->cached_gp_ctrl);
-                       if (ret < 0) {
-                               mutex_unlock(&st->lock);
+                       if (ret < 0)
                                return ret;
-                       }
 
                        if (chan->output) {
                                if (gain)
--
Quoted 2 lines

2.47.2

Thanks for spotting it.

maintainer Applied
#4 lore raw
In reply to Dan Carpenter
Quoted 5 lines · On Wed, 16 Apr 2025 14:09:33 +0300 Dan Carpenter <[email protected]>…

This code was converted to use guard locks but one of the unlocks was accidentally overlooked. Delete it.

Fixes f8fedb167ba4 ("iio: dac: ad5592r: use lock guards")

Applied. Thanks.

Quoted 20 lines
---
 drivers/iio/dac/ad5592r-base.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/dac/ad5592r-base.c +1 -3
index 217a8a88818d..5f2cd51723f6 100644
@@ -324,10 +324,8 @@ static int ad5592r_write_raw(struct iio_dev *iio_dev,
 
 			ret = st->ops->reg_read(st, AD5592R_REG_CTRL,
 						&st->cached_gp_ctrl);
-			if (ret < 0) {
-				mutex_unlock(&st->lock);
+			if (ret < 0)
 				return ret;
-			}
 
 			if (chan->output) {
 				if (gain)