diff mbox series

[3/6] usb: gadget: Track driver data as part of struct usb_gadget

Message ID 20240826143851.8020-3-marek.vasut+renesas@mailbox.org
State Accepted
Delegated to: Mattijs Korpershoek
Headers show
Series [1/6] usb: gadget: Inline usb_add_gadget_udc_release | expand

Commit Message

Marek Vasut Aug. 26, 2024, 2:38 p.m. UTC
Move driver data directly into struct usb_gadget {} in preparation for
conversion of struct device to struct udevice * in struct usb_gadget.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Nishanth Menon <nm@ti.com>
Cc: Zixun LI <admin@hifiphile.com>
---
 include/linux/usb/gadget.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Mattijs Korpershoek Aug. 29, 2024, 7:42 a.m. UTC | #1
Hi Marek,

Thank you for the patch.

On lun., août 26, 2024 at 16:38, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:

> Move driver data directly into struct usb_gadget {} in preparation for
> conversion of struct device to struct udevice * in struct usb_gadget.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lukasz Majewski <lukma@denx.de>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Zixun LI <admin@hifiphile.com>
> ---
>  include/linux/usb/gadget.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index d62fba0ca02..a2b8520bc99 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -544,17 +544,18 @@ struct usb_gadget {
>  	unsigned			a_alt_hnp_support:1;
>  	const char			*name;
>  	struct device			dev;
> +	void				*driver_data;
>  	unsigned			quirk_ep_out_aligned_size:1;
>  };
>  
>  static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
>  {
> -	gadget->dev.driver_data = data;
> +	gadget->driver_data = data;
>  }
>  
>  static inline void *get_gadget_data(struct usb_gadget *gadget)
>  {
> -	return gadget->dev.driver_data;
> +	return gadget->driver_data;
>  }
>  
>  static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
> -- 
> 2.45.2
diff mbox series

Patch

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d62fba0ca02..a2b8520bc99 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -544,17 +544,18 @@  struct usb_gadget {
 	unsigned			a_alt_hnp_support:1;
 	const char			*name;
 	struct device			dev;
+	void				*driver_data;
 	unsigned			quirk_ep_out_aligned_size:1;
 };
 
 static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
 {
-	gadget->dev.driver_data = data;
+	gadget->driver_data = data;
 }
 
 static inline void *get_gadget_data(struct usb_gadget *gadget)
 {
-	return gadget->dev.driver_data;
+	return gadget->driver_data;
 }
 
 static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)