From: "Uwe Kleine-König" <ukleinek@debian.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-iio@vger.kernel.org, Yves-Alexis Perez <corsac@debian.org>
Subject: [PATCH 3/3] iio: humidity: dht11: Use dev_err_probe consistently
Date: Mon, 18 Jul 2022 21:35:20 +0200 [thread overview]
Message-ID: <20220718193520.177648-3-ukleinek@debian.org> (raw)
In-Reply-To: <20220718193520.177648-1-ukleinek@debian.org>
All but one error path use dev_err_probe() to emit a message. Use the same
incarnation for the remaining exit point for consistency.
Signed-off-by: Uwe Kleine-König <ukleinek@debian.org>
---
drivers/iio/humidity/dht11.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c
index 6182f4d2e9fc..50d2431c938b 100644
--- a/drivers/iio/humidity/dht11.c
+++ b/drivers/iio/humidity/dht11.c
@@ -306,10 +306,9 @@ static int dht11_probe(struct platform_device *pdev)
"Failed to aquire GPIO\n");
dht11->irq = gpiod_to_irq(dht11->gpiod);
- if (dht11->irq < 0) {
- dev_err(dev, "GPIO %d has no interrupt\n", desc_to_gpio(dht11->gpiod));
- return -EINVAL;
- }
+ if (dht11->irq < 0)
+ return dev_err_probe(dev, -EINVAL, "GPIO %d has no interrupt\n",
+ desc_to_gpio(dht11->gpiod));
dht11->timestamp = ktime_get_boottime_ns() - DHT11_DATA_VALID_TIME - 1;
dht11->num_edges = -1;
--
2.36.1
prev parent reply other threads:[~2022-07-18 19:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 19:35 [PATCH 1/3] iio: humidity: dht11: Don't warn on memory allocation failure Uwe Kleine-König
2022-07-18 19:35 ` [PATCH 2/3] iio: humidity: dht11: Emit error messages for probe failures Uwe Kleine-König
2022-07-18 19:35 ` Uwe Kleine-König [this message]
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=20220718193520.177648-3-ukleinek@debian.org \
--to=ukleinek@debian.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corsac@debian.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox