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 1/3] iio: humidity: dht11: Don't warn on memory allocation failure
Date: Mon, 18 Jul 2022 21:35:18 +0200 [thread overview]
Message-ID: <20220718193520.177648-1-ukleinek@debian.org> (raw)
The kernel is already quite noisy if a memory allocation fails. So it's
the usual policy to not add another message on the driver level.
Drop the error message accordingly.
Signed-off-by: Uwe Kleine-König <ukleinek@debian.org>
---
drivers/iio/humidity/dht11.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c
index c97e25448772..891b6bf0b4ca 100644
--- a/drivers/iio/humidity/dht11.c
+++ b/drivers/iio/humidity/dht11.c
@@ -295,10 +295,8 @@ static int dht11_probe(struct platform_device *pdev)
struct iio_dev *iio;
iio = devm_iio_device_alloc(dev, sizeof(*dht11));
- if (!iio) {
- dev_err(dev, "Failed to allocate IIO device\n");
+ if (!iio)
return -ENOMEM;
- }
dht11 = iio_priv(iio);
dht11->dev = dev;
base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
--
2.36.1
next 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 Uwe Kleine-König [this message]
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 ` [PATCH 3/3] iio: humidity: dht11: Use dev_err_probe consistently Uwe Kleine-König
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-1-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