[PATCH 1/6] usb: gadget: Inline usb_add_gadget_udc_release
Mattijs Korpershoek
mkorpershoek at baylibre.com
Thu Aug 29 09:08:41 CEST 2024
Hi Marek,
Thank you for the patch.
On lun., août 26, 2024 at 16:38, Marek Vasut <marek.vasut+renesas at mailbox.org> wrote:
> The release parameter of usb_add_gadget_udc_release() is never used.
> The function is never called from anywhere except from a wrapper in
> udc-core.c . Inline the function into the wrapper.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>
> ---
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Cc: Lukasz Majewski <lukma at denx.de>
> Cc: Mattijs Korpershoek <mkorpershoek at baylibre.com>
> Cc: Miquel Raynal <miquel.raynal at bootlin.com>
> Cc: Neil Armstrong <neil.armstrong at linaro.org>
> Cc: Nishanth Menon <nm at ti.com>
> Cc: Zixun LI <admin at hifiphile.com>
> ---
> drivers/usb/gadget/udc/udc-core.c | 20 ++------------------
> include/linux/usb/gadget.h | 2 --
> 2 files changed, 2 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
> index 6bb419ae2ab..37c0ee43c52 100644
> --- a/drivers/usb/gadget/udc/udc-core.c
> +++ b/drivers/usb/gadget/udc/udc-core.c
> @@ -166,16 +166,14 @@ static void usb_udc_release(struct device *dev)
> }
>
> /**
> - * usb_add_gadget_udc_release - adds a new gadget to the udc class driver list
> + * usb_add_gadget_udc - adds a new gadget to the udc class driver list
> * @parent: the parent device to this udc. Usually the controller driver's
> * device.
> * @gadget: the gadget to be added to the list.
> - * @release: a gadget release function.
> *
> * Returns zero on success, negative errno otherwise.
> */
> -int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
> - void (*release)(struct device *dev))
> +int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget)
> {
> struct usb_udc *udc;
> int ret = -ENOMEM;
> @@ -205,20 +203,6 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
> err1:
> return ret;
> }
> -EXPORT_SYMBOL_GPL(usb_add_gadget_udc_release);
> -
> -/**
> - * usb_add_gadget_udc - adds a new gadget to the udc class driver list
> - * @parent: the parent device to this udc. Usually the controller
> - * driver's device.
> - * @gadget: the gadget to be added to the list
> - *
> - * Returns zero on success, negative errno otherwise.
> - */
> -int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget)
> -{
> - return usb_add_gadget_udc_release(parent, gadget, NULL);
> -}
> EXPORT_SYMBOL_GPL(usb_add_gadget_udc);
>
> static void usb_gadget_remove_driver(struct usb_udc *udc)
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index c7927df15aa..d62fba0ca02 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -890,8 +890,6 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver);
> */
> int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
>
> -int usb_add_gadget_udc_release(struct device *parent,
> - struct usb_gadget *gadget, void (*release)(struct device *dev));
> int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
> void usb_del_gadget_udc(struct usb_gadget *gadget);
> /*-------------------------------------------------------------------------*/
> --
> 2.45.2
More information about the U-Boot
mailing list