diff mbox series

[v2,1/3] usb: host: xhci-plat: add quirks member into struct xhci_plat_priv

Message ID 1567425698-27560-2-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State New, archived
Headers show
Series usb: host: xhci-{plat,rcar}: clean up the drivers | expand

Commit Message

Yoshihiro Shimoda Sept. 2, 2019, 12:01 p.m. UTC
To simplify adding xhci->quirks instead of the .init_quirk()
function, this patch adds a new parameter "quirks" into
the struct xhci_plat_priv.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/usb/host/xhci-plat.c | 4 +++-
 drivers/usb/host/xhci-plat.h | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Greg Kroah-Hartman Sept. 3, 2019, 1:52 p.m. UTC | #1
On Mon, Sep 02, 2019 at 09:01:36PM +0900, Yoshihiro Shimoda wrote:
> To simplify adding xhci->quirks instead of the .init_quirk()
> function, this patch adds a new parameter "quirks" into
> the struct xhci_plat_priv.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  drivers/usb/host/xhci-plat.c | 4 +++-
>  drivers/usb/host/xhci-plat.h | 2 ++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index a1e5ce4..1843b69 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -66,12 +66,14 @@ static int xhci_priv_resume_quirk(struct usb_hcd *hcd)
>  
>  static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
>  {
> +	struct xhci_plat_priv *priv = xhci_to_priv(xhci);
> +
>  	/*
>  	 * As of now platform drivers don't provide MSI support so we ensure
>  	 * here that the generic code does not try to make a pci_dev from our
>  	 * dev struct in order to setup MSI
>  	 */
> -	xhci->quirks |= XHCI_PLAT;
> +	xhci->quirks |= XHCI_PLAT | priv->quirks;
>  }
>  
>  /* called during probe() after chip reset completes */
> diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h
> index ae29f22..5681723 100644
> --- a/drivers/usb/host/xhci-plat.h
> +++ b/drivers/usb/host/xhci-plat.h
> @@ -12,10 +12,12 @@
>  
>  struct xhci_plat_priv {
>  	const char *firmware_name;
> +	unsigned long long quirks;

So you mean u64?  Or something else?

Please be specific here so we know the size of this field.

Ugh, looks like xhci.c uses unsigned long long too, ok, nevermind :(
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index a1e5ce4..1843b69 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -66,12 +66,14 @@  static int xhci_priv_resume_quirk(struct usb_hcd *hcd)
 
 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
+	struct xhci_plat_priv *priv = xhci_to_priv(xhci);
+
 	/*
 	 * As of now platform drivers don't provide MSI support so we ensure
 	 * here that the generic code does not try to make a pci_dev from our
 	 * dev struct in order to setup MSI
 	 */
-	xhci->quirks |= XHCI_PLAT;
+	xhci->quirks |= XHCI_PLAT | priv->quirks;
 }
 
 /* called during probe() after chip reset completes */
diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h
index ae29f22..5681723 100644
--- a/drivers/usb/host/xhci-plat.h
+++ b/drivers/usb/host/xhci-plat.h
@@ -12,10 +12,12 @@ 
 
 struct xhci_plat_priv {
 	const char *firmware_name;
+	unsigned long long quirks;
 	void (*plat_start)(struct usb_hcd *);
 	int (*init_quirk)(struct usb_hcd *);
 	int (*resume_quirk)(struct usb_hcd *);
 };
 
 #define hcd_to_xhci_priv(h) ((struct xhci_plat_priv *)hcd_to_xhci(h)->priv)
+#define xhci_to_priv(x) ((struct xhci_plat_priv *)(x)->priv)
 #endif	/* _XHCI_PLAT_H */