OSDN Git Service

video: backlight: tosa_lcd: drop check because i2c_unregister_device() is NULL safe
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 20 Aug 2019 15:34:39 +0000 (17:34 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 2 Sep 2019 14:54:47 +0000 (15:54 +0100)
No need to check the argument of i2c_unregister_device() because the
function itself does it.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/tosa_lcd.c

index 65cb757..29af8e2 100644 (file)
@@ -222,8 +222,7 @@ static int tosa_lcd_remove(struct spi_device *spi)
 {
        struct tosa_lcd_data *data = spi_get_drvdata(spi);
 
-       if (data->i2c)
-               i2c_unregister_device(data->i2c);
+       i2c_unregister_device(data->i2c);
 
        tosa_lcd_tg_off(data);