linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: vncl4000: Fix early return in vcnl4200_set_power_state
@ 2020-02-07  9:12 Guido Günther
  2020-02-07 19:45 ` Matt Ranostay
  2020-02-08 14:17 ` Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Guido Günther @ 2020-02-07  9:12 UTC (permalink / raw)
  To: Tomas Novotny, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Angus Ainslie (Purism),
	Guido Günther, Marco Felsch, Thomas Gleixner, linux-iio,
	linux-kernel

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


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

end of thread, other threads:[~2020-02-10 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07  9:12 [PATCH] iio: vncl4000: Fix early return in vcnl4200_set_power_state Guido Günther
2020-02-07 19:45 ` Matt Ranostay
2020-02-08 14:17 ` Jonathan Cameron
2020-02-10 15:41   ` Exposing device properties for priximity sensors Guido Günther

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).