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

36 lines
1.1 KiB
Diff

From 08966aa19ad6d5e3d5fa02cf653126a4ecf4ab9f Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sun, 17 Jan 2021 23:19:52 +0100
Subject: [PATCH 388/478] 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 <megous@megous.com>
---
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 5c8e94b6cdb5..43bd2c4f3789 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -900,6 +900,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