soundwire: Fix typo in return value check of sdw_read()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 8 Jan 2018 16:52:44 +0000 (22:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 16:53:21 +0000 (17:53 +0100)
Fix the typo, 'status' should be instead of 'status2'.

Fixes: b0a9c37b0178 ("soundwire: Add slave status handling")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/soundwire/bus.c

index 7211ecc62015693dd2c42e7bc4512c5420509af5..03313590b661e87b61f6fee84ed4f45935938ba7 100644 (file)
@@ -671,8 +671,8 @@ static int sdw_handle_dp0_interrupt(struct sdw_slave *slave, u8 *slave_status)
                status2 = sdw_read(slave, SDW_DP0_INT);
                if (status2 < 0) {
                        dev_err(slave->bus->dev,
-                               "SDW_DP0_INT read failed:%d", status);
-                       return status;
+                               "SDW_DP0_INT read failed:%d", status2);
+                       return status2;
                }
                status &= status2;
 
@@ -741,10 +741,10 @@ static int sdw_handle_port_interrupt(struct sdw_slave *slave,
 
                /* Read DPN interrupt again */
                status2 = sdw_read(slave, addr);
-               if (status < 0) {
+               if (status2 < 0) {
                        dev_err(slave->bus->dev,
-                                       "SDW_DPN_INT read failed:%d", status);
-                       return status;
+                                       "SDW_DPN_INT read failed:%d", status2);
+                       return status2;
                }
                status &= status2;