[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <169538340502.2915094.11564554500846900939@ping.linuxembedded.co.uk>
Date: Fri, 22 Sep 2023 12:50:05 +0100
From: Kieran Bingham <kieran.bingham@...asonboard.com>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>,
linux-renesas-soc@...r.kernel.org
Cc: Wolfram Sang <wsa+renesas@...g-engineering.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] usb: typec: drop check because i2c_unregister_device() is NULL safe
Quoting Wolfram Sang (2023-09-22 09:04:18)
> No need to check the argument of i2c_unregister_device() because the
> function itself does it.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
And this is the same pattern here so:
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
> ---
> Build tested only. Please apply to your tree.
>
> drivers/usb/typec/anx7411.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c
> index 221604f933a4..b12a07edc71b 100644
> --- a/drivers/usb/typec/anx7411.c
> +++ b/drivers/usb/typec/anx7411.c
> @@ -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);
> --
> 2.30.2
>
Powered by blists - more mailing lists