Skip to contentSkip to conversation

soundwire: bus: provide correct return value on error

PATCH Applied Pierre-Louis Bossart 2 participants 2 messages Feb 27, 2020 – Mar 3, 2020 SoundWire

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 soundwire: bus: provide correct return value on error

From: Bard Liao <[email protected]>

It seems to be a typo. It makes more sense to return the return value of sdw_update() instead of the value we want to update.

---

v2: address Vinod's comment and use single return

 drivers/soundwire/bus.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/soundwire/bus.c +2 -5
index ccaa590df61e..488c3c9e4947 100644
@@ -1056,13 +1056,10 @@ static int sdw_initialize_slave(struct sdw_slave *slave)
 	val |= SDW_DP0_INT_PORT_READY | SDW_DP0_INT_BRA_FAILURE;
 
 	ret = sdw_update(slave, SDW_DP0_INTMASK, val, val);
-	if (ret < 0) {
+	if (ret < 0)
 		dev_err(slave->bus->dev,
 			"SDW_DP0_INTMASK read failed:%d\n", ret);
-		return val;
-	}
-
-	return 0;
+	return ret;
 }
 
 static int sdw_handle_dp0_interrupt(struct sdw_slave *slave, u8 *slave_status)
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Pierre-Louis Bossart

From: Bard Liao <[email protected]>

It seems to be a typo. It makes more sense to return the return value of sdw_update() instead of the value we want to update.

Applied, thanks

Signature · 1 line
~Vinod