]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: host: xhci-rcar: Add a helper macro to set xhci_plat_priv
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 2 Sep 2019 12:01:37 +0000 (21:01 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Sep 2019 13:53:11 +0000 (15:53 +0200)
To avoid copy-and-paste setting of xhci_plat_priv for R-Car SoCs,
this patch add a helper macro SET_XHCI_PLAT_PRIV_FOR_RCAR.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/1567425698-27560-3-git-send-email-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci-rcar.h

index 1843b698b78ac440d9a274f7910fcd999bfacca9..d90cd5ec09cf2d2129fd4f3d47f8bffb692d03d0 100644 (file)
@@ -105,17 +105,11 @@ static const struct xhci_plat_priv xhci_plat_marvell_armada3700 = {
 };
 
 static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
-       .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
-       .init_quirk = xhci_rcar_init_quirk,
-       .plat_start = xhci_rcar_start,
-       .resume_quirk = xhci_rcar_resume_quirk,
+       SET_XHCI_PLAT_PRIV_FOR_RCAR(XHCI_RCAR_FIRMWARE_NAME_V1)
 };
 
 static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = {
-       .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V3,
-       .init_quirk = xhci_rcar_init_quirk,
-       .plat_start = xhci_rcar_start,
-       .resume_quirk = xhci_rcar_resume_quirk,
+       SET_XHCI_PLAT_PRIV_FOR_RCAR(XHCI_RCAR_FIRMWARE_NAME_V3)
 };
 
 static const struct of_device_id usb_xhci_of_match[] = {
index 804b6ab4246f20b29af67af8641fff1cc78dac28..1f8c22506a92218e735ddde28d296149d9c371bb 100644 (file)
@@ -31,4 +31,11 @@ static inline int xhci_rcar_resume_quirk(struct usb_hcd *hcd)
        return 0;
 }
 #endif
+
+#define SET_XHCI_PLAT_PRIV_FOR_RCAR(firmware)                          \
+       .firmware_name = firmware,                                      \
+       .init_quirk = xhci_rcar_init_quirk,                             \
+       .plat_start = xhci_rcar_start,                                  \
+       .resume_quirk = xhci_rcar_resume_quirk,
+
 #endif /* _XHCI_RCAR_H */