On Tue, 31 Oct 2017 16:21:43 +0200, Andy Shevchenko wrote:
> Since i2c_unregister_device() became NULL-aware we may remove duplicate
> NULL check.
> 
> Cc: Jean Delvare <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Cc: [email protected]
> Signed-off-by: Andy Shevchenko <[email protected]>
> ---
>  drivers/hwmon/w83781d.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
> index 246fb2365126..2b0f182daa87 100644
> --- a/drivers/hwmon/w83781d.c
> +++ b/drivers/hwmon/w83781d.c
> @@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct 
> i2c_device_id *id)
>  
>   exit_remove_files:
>       w83781d_remove_files(dev);
> -     if (data->lm75[0])
> -             i2c_unregister_device(data->lm75[0]);
> -     if (data->lm75[1])
> -             i2c_unregister_device(data->lm75[1]);
> +     i2c_unregister_device(data->lm75[0]);
> +     i2c_unregister_device(data->lm75[1]);
>       return err;
>  }
>  
> @@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client)
>       hwmon_device_unregister(data->hwmon_dev);
>       w83781d_remove_files(dev);
>  
> -     if (data->lm75[0])
> -             i2c_unregister_device(data->lm75[0]);
> -     if (data->lm75[1])
> -             i2c_unregister_device(data->lm75[1]);
> +     i2c_unregister_device(data->lm75[0]);
> +     i2c_unregister_device(data->lm75[1]);
>  
>       return 0;
>  }

Reviewed-by: Jean Delvare <[email protected]>

-- 
Jean Delvare
SUSE L3 Support
--
To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to