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

Yann Sionneau posted 4 patches 2 years, 4 months ago
[PATCH 1/4] i2c: mv64xxx: devm_pinctrl_get() cannot return NULL
Posted by Yann Sionneau 2 years, 4 months ago
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(-)

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;
-- 
2.34.1
Re: [PATCH 1/4] i2c: mv64xxx: devm_pinctrl_get() cannot return NULL
Posted by Wolfram Sang 2 years, 3 months ago
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.