linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guido Günther" <agx@sigxcpu.org>
To: "Tomas Novotny" <tomas@novotny.cz>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Hartmut Knaack" <knaack.h@gmx.de>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
	"Angus Ainslie (Purism)" <angus@akkea.ca>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Marco Felsch" <m.felsch@pengutronix.de>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] iio: vncl4000: Fix early return in vcnl4200_set_power_state
Date: Fri,  7 Feb 2020 10:12:09 +0100	[thread overview]
Message-ID: <19efdcd597b21ece9ad0ff894b6566d2ef4e2c02.1581066317.git.agx@sigxcpu.org> (raw)

Don't return early unconditionally.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

---
I've not added a 'Fixes:' line since this is not part of Linus tree yet.
Tested proximity and ambient light on a vcnl4040 and checked the driver
suspends/resumes correctly and puts out valid data right after resume.  

 drivers/iio/light/vcnl4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 3b71c7d538af..38fcd9a26046 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -149,7 +149,7 @@ static int vcnl4200_set_power_state(struct vcnl4000_data *data, bool on)
 	if (ret < 0)
 		return ret;
 
-	return i2c_smbus_write_word_data(data->client, VCNL4200_PS_CONF1, val);
+	ret = i2c_smbus_write_word_data(data->client, VCNL4200_PS_CONF1, val);
 	if (ret < 0)
 		return ret;
 
-- 
2.23.0


             reply	other threads:[~2020-02-07  9:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07  9:12 Guido Günther [this message]
2020-02-07 19:45 ` [PATCH] iio: vncl4000: Fix early return in vcnl4200_set_power_state Matt Ranostay
2020-02-08 14:17 ` Jonathan Cameron
2020-02-10 15:41   ` Exposing device properties for priximity sensors Guido Günther

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=19efdcd597b21ece9ad0ff894b6566d2ef4e2c02.1581066317.git.agx@sigxcpu.org \
    --to=agx@sigxcpu.org \
    --cc=angus@akkea.ca \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=pmeerw@pmeerw.net \
    --cc=tglx@linutronix.de \
    --cc=tomas@novotny.cz \
    /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).