From: Shreyas NC Date: Tue, 9 Jan 2018 04:45:46 +0000 (+0530) Subject: soundwire: Fix incorrect return value check X-Git-Tag: v5.15~9509^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c22c0ae5232e2280a12cdf389fdc557b83c5b968;p=platform%2Fkernel%2Flinux-starfive.git 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 Reported-by: Dan Carpenter Fixes: 9d715fa005eb: ("soundwire: Add IO transfer") Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 0331359..5d7226c 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);