linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soundwire: fix pm_runtime_get_sync return code checks
@ 2019-04-05  7:26 Jan Kotas
       [not found] ` <367316fa-9d92-2dfc-32c4-3e0e8c76ef43@linux.intel.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kotas @ 2019-04-05  7:26 UTC (permalink / raw)
  To: vkoul, sanyog.r.kale, pierre-louis.bossart
  Cc: alsa-devel, linux-kernel, Jan Kotas

When PM is disabled it returns -EACCES, which is currently
threated as an error, and prevents accessing the slave's
registers.

This patch ignores the -EACCES return value from
pm_runtime_get_sync() to let the SoundWire work in systems
without runtime PM.

Signed-off-by: Jan Kotas <jank@cadence.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 1cbfedfc2..6567ff439 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -328,7 +328,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 < 0)
+	if (ret < 0 && ret != -EACCES)
 		return ret;
 
 	ret = sdw_transfer(slave->bus, &msg);
@@ -356,7 +356,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 < 0)
+	if (ret < 0 && ret != -EACCES)
 		return ret;
 
 	ret = sdw_transfer(slave->bus, &msg);
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-14 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05  7:26 [PATCH] soundwire: fix pm_runtime_get_sync return code checks Jan Kotas
     [not found] ` <367316fa-9d92-2dfc-32c4-3e0e8c76ef43@linux.intel.com>
2019-04-08  7:12   ` Jan Kotas
2019-04-08 17:43     ` [alsa-devel] " Pierre-Louis Bossart
2019-04-14 10:26       ` 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).