Input: ads7846 - ratelimit the spi_sync error message
authorMarek Vasut <marex@denx.de>
Mon, 8 Jul 2024 21:18:57 +0000 (23:18 +0200)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 24 Jul 2024 04:10:25 +0000 (21:10 -0700)
In case the touch controller is not connected, this message keeps scrolling
on the console indefinitelly. Ratelimit it to avoid filling kernel logs.

"
ads7846 spi2.1: spi_sync --> -22
"

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20240708211913.171243-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/ads7846.c

index 4247283c7271d5eedab871f48dbe39fb87a2d9bc..f89c0dd15d8b91a426e967f62122fb025fafa21c 100644 (file)
@@ -824,7 +824,7 @@ static void ads7846_read_state(struct ads7846 *ts)
                m = &ts->msg[msg_idx];
                error = spi_sync(ts->spi, m);
                if (error) {
-                       dev_err(&ts->spi->dev, "spi_sync --> %d\n", error);
+                       dev_err_ratelimited(&ts->spi->dev, "spi_sync --> %d\n", error);
                        packet->ignore = true;
                        return;
                }