summaryrefslogtreecommitdiffstats
path: root/drivers/soundwire
diff options
context:
space:
mode:
authorShreyas NC <shreyas.nc@intel.com>2018-01-09 10:15:46 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-09 17:01:16 +0100
commitc22c0ae5232e2280a12cdf389fdc557b83c5b968 (patch)
tree79b313c0d24c30799a84a781f4b0ce16cfc3a073 /drivers/soundwire
parentba60eb19340ed081ea46e6ae0061053887151592 (diff)
downloadlinux-c22c0ae5232e2280a12cdf389fdc557b83c5b968.tar.bz2
soundwire: Fix incorrect return value check
pm_runtime_get_sync will return negative values for error and 0 or 1 for success. Update the error check accordingly. Signed-off-by: Shreyas NC <shreyas.nc@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 9d715fa005eb: ("soundwire: Add IO transfer") Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r--drivers/soundwire/bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index 03313590b661..5d7226c251e6 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -305,7 +305,7 @@ int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
return ret;
ret = pm_runtime_get_sync(slave->bus->dev);
- if (!ret)
+ if (ret < 0)
return ret;
ret = sdw_transfer(slave->bus, &msg);
@@ -333,7 +333,7 @@ int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
return ret;
ret = pm_runtime_get_sync(slave->bus->dev);
- if (!ret)
+ if (ret < 0)
return ret;
ret = sdw_transfer(slave->bus, &msg);