public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: dht11: set debug log level for parsing error messages
@ 2024-03-25 16:54 George Stark
  2024-03-25 18:48 ` Harald Geyer
  0 siblings, 1 reply; 7+ messages in thread
From: George Stark @ 2024-03-25 16:54 UTC (permalink / raw)
  To: jic23, lars, harald, gnstark; +Cc: linux-iio, linux-kernel, kernel

Protocol parsing errors could happen due to several reasons like noise
environment, heavy load on system etc. If to poll the sensor frequently
and/or for a long period kernel log will become polluted with error
messages if their log level is err (i.e. on by default). Also some types
of those messages already have dbg level so use unified log level for
all such cases.

Signed-off-by: George Stark <gnstark@salutedevices.com>
---
I use DHT22 sensor with Raspberry Pi Zero W as a simple home meteo station.
Even if to poll the sensor once per tens of seconds after month or two dmesg
may become full of useless parsing error messages. Anyway those errors are caught
in the user software thru return values.

 drivers/iio/humidity/dht11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c
index c97e25448772..e2cbc442177b 100644
--- a/drivers/iio/humidity/dht11.c
+++ b/drivers/iio/humidity/dht11.c
@@ -156,7 +156,7 @@ static int dht11_decode(struct dht11 *dht11, int offset)
 		dht11->temperature = temp_int * 1000;
 		dht11->humidity = hum_int * 1000;
 	} else {
-		dev_err(dht11->dev,
+		dev_dbg(dht11->dev,
 			"Don't know how to decode data: %d %d %d %d\n",
 			hum_int, hum_dec, temp_int, temp_dec);
 		return -EIO;
@@ -239,7 +239,7 @@ static int dht11_read_raw(struct iio_dev *iio_dev,
 #endif

 		if (ret == 0 && dht11->num_edges < DHT11_EDGES_PER_READ - 1) {
-			dev_err(dht11->dev, "Only %d signal edges detected\n",
+			dev_dbg(dht11->dev, "Only %d signal edges detected\n",
 				dht11->num_edges);
 			ret = -ETIMEDOUT;
 		}
--
2.25.1


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

end of thread, other threads:[~2024-04-05 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 16:54 [PATCH] iio: dht11: set debug log level for parsing error messages George Stark
2024-03-25 18:48 ` Harald Geyer
2024-03-25 19:10   ` Jonathan Cameron
2024-03-25 20:18   ` George Stark
2024-03-25 20:42     ` Jonathan Cameron
2024-03-26 14:03     ` Harald Geyer
2024-04-05 20:06       ` George Stark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox