usb: typec: drop check because i2c_unregister_device() is NULL safe
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 22 Sep 2023 08:04:18 +0000 (10:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Oct 2023 11:56:37 +0000 (13:56 +0200)
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: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20230922080421.35145-2-wsa+renesas@sang-engineering.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/anx7411.c

index 221604f933a40bf66b05bab30061b1ead9bc837d..b12a07edc71bb5499b86b4200dad4552f33e3bf8 100644 (file)
@@ -1550,8 +1550,7 @@ static void anx7411_i2c_remove(struct i2c_client *client)
        if (plat->workqueue)
                destroy_workqueue(plat->workqueue);
 
-       if (plat->spi_client)
-               i2c_unregister_device(plat->spi_client);
+       i2c_unregister_device(plat->spi_client);
 
        if (plat->typec.role_sw)
                usb_role_switch_put(plat->typec.role_sw);