build/patch/kernel/archive/sunxi-6.1/patches.megous/i2c-mv64xxx-Don-t-make-a-fuss-when-pinctrl-recovery-state-is-no.patch

36 lines
1.1 KiB
Diff

From f650eeb87b09b27ef133d870cce2255ff401f922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 17 Jan 2021 23:19:52 +0100
Subject: [PATCH 237/389] i2c: mv64xxx: Don't make a fuss when pinctrl recovery
state is not present
Otherwise dmesg log presents a useless error.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/i2c/busses/i2c-mv64xxx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 047dfef7a657..6fbbf44b5230 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -940,6 +940,14 @@ static int mv64xxx_i2c_init_recovery_info(struct mv64xxx_i2c_data *drv_data,
return -ENODEV;
}
+ if (IS_ERR(pinctrl_lookup_state(rinfo->pinctrl, "gpio")) &&
+ IS_ERR(pinctrl_lookup_state(rinfo->pinctrl, "recovery"))) {
+ /* No recovery state is vailable in pinctrl. */
+ devm_pinctrl_put(rinfo->pinctrl);
+ rinfo->pinctrl = NULL;
+ return 0;
+ }
+
drv_data->adapter.bus_recovery_info = rinfo;
return 0;
}
--
2.35.3