build/patch/kernel/archive/sunxi-6.1/patches.megous/input-pinephone-keyboard-Don-t-print-error-when-the-keyboard-is.patch

34 lines
1.1 KiB
Diff
Raw Normal View History

From eb1e12347304188fa791a942829943084cd84516 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 29 Oct 2022 23:18:38 +0200
Subject: [PATCH 326/389] input: pinephone-keyboard: Don't print error when the
keyboard is not connected
This is needlessly nosiy for people who don't have KB connected, or
don't own one.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/input/keyboard/pinephone-keyboard.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/keyboard/pinephone-keyboard.c
index 00e4921f49ad..ee4c26a1b08a 100644
--- a/drivers/input/keyboard/pinephone-keyboard.c
+++ b/drivers/input/keyboard/pinephone-keyboard.c
@@ -371,6 +371,11 @@ static int ppkb_probe(struct i2c_client *client)
ret = i2c_smbus_read_i2c_block_data(client, 0, sizeof(info), info);
if (ret != sizeof(info)) {
error = ret < 0 ? ret : -EIO;
+ if (error == -ENXIO) {
+ dev_info(dev, "Keyboard was not found on the I2C bus, maybe it's disconnected.\n");
+ return error;
+ }
+
dev_err(dev, "Failed to read device ID: %d\n", error);
return error;
}
--
2.35.3