Skip to contentSkip to conversation

iio: humidity: Remove a stray unlock

PATCH Superseded Dan Carpenter 3 participants 5 messages May 17, 2016 – May 21, 2016

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

PATCH 1/1 iio: humidity: Remove a stray unlock

We haven't taken the lock yet so we don't need to unlock here.

Fixes 0d96d5ead3f7 ('iio: humidity: Add triggered buffer support for AM2315')
drivers/iio/humidity/am2315.c +1 -3
index 3be6d20..1153591 100644
@@ -165,10 +165,8 @@ static irqreturn_t am2315_trigger_handler(int irq, void *p)
 	struct am2315_sensor_data sensor_data;
 
 	ret = am2315_read_data(data, &sensor_data);
-	if (ret < 0) {
-		mutex_unlock(&data->lock);
+	if (ret < 0)
 		goto err;
-	}
 
 	mutex_lock(&data->lock);
 	if (*(indio_dev->active_scan_mask) = AM2315_ALL_CHANNEL_MASK) {
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, May 17, 2016 10:32 AM
To: Jonathan Cameron <[email protected]>; Breana, Tiberiu A <[email protected]>
Cc: Hartmut Knaack <[email protected]>; Lars-Peter Clausen <[email protected]>; Peter Meerwald-Stadler <[email protected]>; [email protected]; [email protected]
Subject: [patch] iio: humidity: Remove a stray unlock

We haven't taken the lock yet so we don't need to unlock here.

Fixes 0d96d5ead3f7 ('iio: humidity: Add triggered buffer support for

AM2315')

drivers/iio/humidity/am2315.c +1 -3
index 3be6d20..1153591 100644
@@ -165,10 +165,8 @@ static irqreturn_t am2315_trigger_handler(int irq,
 void *p)
 	struct am2315_sensor_data sensor_data;
 
 	ret = am2315_read_data(data, &sensor_data);
-	if (ret < 0) {
-		mutex_unlock(&data->lock);
+	if (ret < 0)
 		goto err;
-	}
 
 	mutex_lock(&data->lock);
Quoted 2 lines

if (*(indio_dev->active_scan_mask) =
AM2315_ALL_CHANNEL_MASK) {

That one must have slipped by during development versions. You might also want to add am2315 in the patch title. Thanks,

#2 lore raw
Quoted 2 lines · Tiberiu A

That one must have slipped by during development versions. You might also want to add am2315 in the patch title.

Yeah. I'll resend.

I obviously just mindlessly cut and pasted that from the earlier patch:

Fixes 0d96d5ead3f7 ('iio: humidity: Add triggered buffer support for AM2315')

That patch also has the wrong subject line because it was just copied from the first patch 366a3270c1c5 ('iio: humidity: Add support for AM2315').

And just a few minutes ago I was giving another new driver its own prefix. But even though I thought--more than I should have--about what the author wanted to use as a prefix for his driver, I still probably read his mind incorrectly.

In other words, we need to start with the correct prefix from square
one: iio: humidity: am2315: Add support for AM2315

regards,
dan carpenter

#3 lore raw

PATCH v2 1/1 iio: humidity: am2315: Remove a stray unlock

In reply to Breana, Tiberiu A

We haven't taken the lock yet so we don't need to unlock here.

Fixes 0d96d5ead3f7 ('iio: humidity: Add triggered buffer support for AM2315')

---
v2: update subject

drivers/iio/humidity/am2315.c +1 -3
index 3be6d20..1153591 100644
@@ -165,10 +165,8 @@ static irqreturn_t am2315_trigger_handler(int irq, void *p)
 	struct am2315_sensor_data sensor_data;
 
 	ret = am2315_read_data(data, &sensor_data);
-	if (ret < 0) {
-		mutex_unlock(&data->lock);
+	if (ret < 0)
 		goto err;
-	}
 
 	mutex_lock(&data->lock);
 	if (*(indio_dev->active_scan_mask) = AM2315_ALL_CHANNEL_MASK) {
maintainer Applied
#4 lore raw

Re: [patch v2] iio: humidity: am2315: Remove a stray unlock

Quoted 5 lines · Dan Carpenter

We haven't taken the lock yet so we don't need to unlock here.

Fixes 0d96d5ead3f7 ('iio: humidity: Add triggered buffer support for AM2315')

Applied to the fixes-togreg-post-rc1 branch of iio.git

Thanks,

Jonathan

Quoted 20 lines

---
v2: update subject

drivers/iio/humidity/am2315.c +1 -3
index 3be6d20..1153591 100644
@@ -165,10 +165,8 @@ static irqreturn_t am2315_trigger_handler(int irq, void *p)
 	struct am2315_sensor_data sensor_data;
 
 	ret = am2315_read_data(data, &sensor_data);
-	if (ret < 0) {
-		mutex_unlock(&data->lock);
+	if (ret < 0)
 		goto err;
-	}
 
 	mutex_lock(&data->lock);
 	if (*(indio_dev->active_scan_mask) = AM2315_ALL_CHANNEL_MASK) {