linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kotas <jank@cadence.com>
To: <vkoul@kernel.org>, <sanyog.r.kale@intel.com>,
	<pierre-louis.bossart@linux.intel.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	Jan Kotas <jank@cadence.com>
Subject: [PATCH] soundwire: fix pm_runtime_get_sync return code checks
Date: Fri, 5 Apr 2019 08:26:55 +0100	[thread overview]
Message-ID: <20190405072655.25995-1-jank@cadence.com> (raw)

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


             reply	other threads:[~2019-04-05  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05  7:26 Jan Kotas [this message]
     [not found] ` <367316fa-9d92-2dfc-32c4-3e0e8c76ef43@linux.intel.com>
2019-04-08  7:12   ` [PATCH] soundwire: fix pm_runtime_get_sync return code checks Jan Kotas
2019-04-08 17:43     ` [alsa-devel] " Pierre-Louis Bossart
2019-04-14 10:26       ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190405072655.25995-1-jank@cadence.com \
    --to=jank@cadence.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).