Commit c22c0ae5 authored by Shreyas NC's avatar Shreyas NC Committed by Greg Kroah-Hartman

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: default avatarShreyas NC <shreyas.nc@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: 9d715fa0: ("soundwire: Add IO transfer")
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba60eb19
......@@ -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);
......
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