diff mbox series

[v1,2/3] i2c: i801: Drop duplicate NULL check in i801_del_mux()

Message ID 20201228200618.58716-2-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/3] gpiolib: Follow usual pattern for gpiod_remove_lookup_table() call | expand

Commit Message

Andy Shevchenko Dec. 28, 2020, 8:06 p.m. UTC
Since gpiod_remove_lookup_table() is NULL-aware, no need to have this check
in the caller. Drop duplicate NULL check.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-i801.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jean Delvare Jan. 6, 2021, 4:03 p.m. UTC | #1
On Mon, 28 Dec 2020 22:06:17 +0200, Andy Shevchenko wrote:
> Since gpiod_remove_lookup_table() is NULL-aware, no need to have this check

> in the caller. Drop duplicate NULL check.

> 

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> ---

>  drivers/i2c/busses/i2c-i801.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c

> index ae90713443fa..7c2569a18f8c 100644

> --- a/drivers/i2c/busses/i2c-i801.c

> +++ b/drivers/i2c/busses/i2c-i801.c

> @@ -1487,8 +1487,7 @@ static void i801_del_mux(struct i801_priv *priv)

>  {

>  	if (priv->mux_pdev)

>  		platform_device_unregister(priv->mux_pdev);

> -	if (priv->lookup)

> -		gpiod_remove_lookup_table(priv->lookup);

> +	gpiod_remove_lookup_table(priv->lookup);

>  }

>  

>  static unsigned int i801_get_adapter_class(struct i801_priv *priv)


Reviewed-by: Jean Delvare <jdelvare@suse.de>


-- 
Jean Delvare
SUSE L3 Support
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ae90713443fa..7c2569a18f8c 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1487,8 +1487,7 @@  static void i801_del_mux(struct i801_priv *priv)
 {
 	if (priv->mux_pdev)
 		platform_device_unregister(priv->mux_pdev);
-	if (priv->lookup)
-		gpiod_remove_lookup_table(priv->lookup);
+	gpiod_remove_lookup_table(priv->lookup);
 }
 
 static unsigned int i801_get_adapter_class(struct i801_priv *priv)