All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
To: joel@jms.id.au
Cc: bsp-development.geo@leica-geosystems.com,
	Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>,
	Eddie James <eajames@linux.ibm.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/4] iio: pressure: dps310: consistently check return value of `regmap_read`
Date: Wed, 10 Apr 2024 12:36:03 +0200	[thread overview]
Message-ID: <20240410103604.992989-4-thomas.haemmerle@leica-geosystems.com> (raw)
In-Reply-To: <20240410103604.992989-1-thomas.haemmerle@leica-geosystems.com>

Align the check of return values `regmap_read` so that it's consistent
across this driver code.

Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
---
 drivers/iio/pressure/dps310.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index a48e8adf63ae..4abce7e40715 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -171,7 +171,7 @@ static int dps310_temp_workaround(struct dps310_data *data)
 	int reg;
 
 	rc = regmap_read(data->regmap, 0x32, &reg);
-	if (rc)
+	if (rc < 0)
 		return rc;
 
 	/*
-- 
2.34.1


  parent reply	other threads:[~2024-04-10 10:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  8:49 [PATCH] iio: pressure: dps310: support negative pressure and temperature values Thomas Haemmerle
2024-03-28 13:34 ` Jonathan Cameron
2024-04-02 11:22   ` HAEMMERLE Thomas
2024-04-06 10:08     ` Jonathan Cameron
2024-04-10 10:36 ` [PATCH v2 0/4] iio: pressure: dps310: support negative " Thomas Haemmerle
2024-04-10 10:36   ` [PATCH v2 1/4] " Thomas Haemmerle
2024-04-10 10:36   ` [PATCH v2 2/4] iio: pressure: dps310: introduce consistent error handling Thomas Haemmerle
2024-04-11 10:14     ` Dan Carpenter
2024-04-13  9:33     ` Jonathan Cameron
2024-04-10 10:36   ` Thomas Haemmerle [this message]
2024-04-10 10:36   ` [PATCH v2 4/4] iio: pressure: dps310: simplify scale factor reading Thomas Haemmerle
2024-04-13  9:27   ` [PATCH v2 0/4] iio: pressure: dps310: support negative temperature values Jonathan Cameron

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=20240410103604.992989-4-thomas.haemmerle@leica-geosystems.com \
    --to=thomas.haemmerle@leica-geosystems.com \
    --cc=bsp-development.geo@leica-geosystems.com \
    --cc=eajames@linux.ibm.com \
    --cc=jic23@kernel.org \
    --cc=joel@jms.id.au \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@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.