All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: devicetree@vger.kernel.org
Subject: [PATCH 2/7] smiapp: Fix error handling at NVM reading
Date: Tue, 24 Sep 2019 14:23:33 +0300	[thread overview]
Message-ID: <20190924112338.27180-3-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20190924112338.27180-1-sakari.ailus@linux.intel.com>

If NVM reading failed, the device was left powered on. Fix that.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 8fa0290ad15c1..13f7a6315f39c 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2326,11 +2326,12 @@ smiapp_sysfs_nvm_read(struct device *dev, struct device_attribute *attr,
 		if (rval < 0) {
 			if (rval != -EBUSY && rval != -EAGAIN)
 				pm_runtime_set_active(&client->dev);
-			pm_runtime_put(&client->dev);
+			pm_runtime_put_noidle(&client->dev);
 			return -ENODEV;
 		}
 
 		if (smiapp_read_nvm(sensor, sensor->nvm)) {
+			pm_runtime_put(&client->dev);
 			dev_err(&client->dev, "nvm read failed\n");
 			return -ENODEV;
 		}
-- 
2.20.1


  parent reply	other threads:[~2019-09-24 11:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 11:23 [PATCH 0/7] SMIA NVM handling improvements Sakari Ailus
2019-09-24 11:23 ` [PATCH 1/7] smiapp: Use the BIT macro where appropriate, remove useless definition Sakari Ailus
2019-09-24 11:23 ` Sakari Ailus [this message]
2019-09-24 11:23 ` [PATCH 3/7] smiapp: Refactor reading NVM page Sakari Ailus
2019-09-24 11:23 ` [PATCH 4/7] smiapp: Add definitions for data transfer if capability bits Sakari Ailus
2019-09-24 11:23 ` [PATCH 5/7] smiapp: Don't poll for NVM ready on devices that don't need it Sakari Ailus
2019-09-24 11:23 ` [PATCH 6/7] smiapp: Support probing NVM size Sakari Ailus
2019-09-24 11:23 ` [PATCH 7/7] dt-bindings: smia: Remove documentation of nokia,nvm-size Sakari Ailus
2019-10-02 14:19   ` Rob Herring

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=20190924112338.27180-3-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-media@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.