linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soundwire: Fix incorrect return value check
@ 2018-01-09  4:45 Vinod Koul
  0 siblings, 0 replies; only message in thread
From: Vinod Koul @ 2018-01-09  4:45 UTC (permalink / raw)
  To: Greg KH; +Cc: LKML, Pierre-Louis Bossart, Sanyog Kale, Shreyas NC, Vinod Koul

From: Shreyas NC <shreyas.nc@intel.com>

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>
---
 drivers/soundwire/bus.c | 4 ++--
 1 file 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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-09  4:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09  4:45 [PATCH] soundwire: Fix incorrect return value check Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).