提交 c22c0ae5 编写于 作者: S Shreyas NC 提交者: 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: NShreyas NC <shreyas.nc@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Fixes: 9d715fa0: ("soundwire: Add IO transfer")
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册