diff mbox series

[1/4] i2c: mv64xxx: devm_pinctrl_get() cannot return NULL

Message ID 20230816200410.62131-2-yann@sionneau.net (mailing list archive)
State New, archived
Headers show
Series i2c: devm_pinctrl_get() usage fixes | expand

Commit Message

Yann Sionneau Aug. 16, 2023, 8:04 p.m. UTC
Remove unnecessary check against NULL for devm_pinctrl_get() return value.

Signed-off-by: Yann Sionneau <yann@sionneau.net>
---
 drivers/i2c/busses/i2c-mv64xxx.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Wolfram Sang Aug. 25, 2023, 9:11 p.m. UTC | #1
On Wed, Aug 16, 2023 at 10:04:07PM +0200, Yann Sionneau wrote:
> Remove unnecessary check against NULL for devm_pinctrl_get() return value.
> 
> Signed-off-by: Yann Sionneau <yann@sionneau.net>

As discussed elsewhere, it can be NULL when pinctrl is not selected.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index fd8403b07fa6..0c4a0110978f 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -947,8 +947,6 @@  static int mv64xxx_i2c_init_recovery_info(struct mv64xxx_i2c_data *drv_data,
 			return -EPROBE_DEFER;
 		dev_info(dev, "can't get pinctrl, bus recovery not supported\n");
 		return PTR_ERR(rinfo->pinctrl);
-	} else if (!rinfo->pinctrl) {
-		return -ENODEV;
 	}
 
 	drv_data->adapter.bus_recovery_info = rinfo;