Commit 72b16d4a authored by Vinod Koul's avatar Vinod Koul Committed by Greg Kroah-Hartman

soundwire: avoid multiple assignments

Modify the code to avoid multiple assignments by assigning to variable
after error checks in soundwire bus.

CHECK: multiple assignments should be avoided
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1215daee
...@@ -812,12 +812,13 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) ...@@ -812,12 +812,13 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
sdw_modify_slave_status(slave, SDW_SLAVE_ALERT); sdw_modify_slave_status(slave, SDW_SLAVE_ALERT);
/* Read Instat 1, Instat 2 and Instat 3 registers */ /* Read Instat 1, Instat 2 and Instat 3 registers */
buf = ret = sdw_read(slave, SDW_SCP_INT1); ret = sdw_read(slave, SDW_SCP_INT1);
if (ret < 0) { if (ret < 0) {
dev_err(slave->bus->dev, dev_err(slave->bus->dev,
"SDW_SCP_INT1 read failed:%d\n", ret); "SDW_SCP_INT1 read failed:%d\n", ret);
return ret; return ret;
} }
buf = ret;
ret = sdw_nread(slave, SDW_SCP_INTSTAT2, 2, buf2); ret = sdw_nread(slave, SDW_SCP_INTSTAT2, 2, buf2);
if (ret < 0) { if (ret < 0) {
...@@ -910,12 +911,13 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) ...@@ -910,12 +911,13 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
* Read status again to ensure no new interrupts arrived * Read status again to ensure no new interrupts arrived
* while servicing interrupts. * while servicing interrupts.
*/ */
_buf = ret = sdw_read(slave, SDW_SCP_INT1); ret = sdw_read(slave, SDW_SCP_INT1);
if (ret < 0) { if (ret < 0) {
dev_err(slave->bus->dev, dev_err(slave->bus->dev,
"SDW_SCP_INT1 read failed:%d\n", ret); "SDW_SCP_INT1 read failed:%d\n", ret);
return ret; return ret;
} }
_buf = ret;
ret = sdw_nread(slave, SDW_SCP_INTSTAT2, 2, _buf2); ret = sdw_nread(slave, SDW_SCP_INTSTAT2, 2, _buf2);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment