Skip to content

Commit

Permalink
usb: typec: drop check because i2c_unregister_device() is NULL safe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Greg Kroah-Hartman committed Oct 2, 2023
1 parent f782152 commit cc07fc8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/typec/anx7411.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cc07fc8

Please sign in to comment.