[PATCH 2/2] drivers:usb:fsl: Use overrides structure for fsl hc driver

From: Ramneek Mehresh
Date: Tue May 12 2015 - 08:13:31 EST


Use overrides structure for fsl ehci host controller driver

Signed-off-by: Ramneek Mehresh <ramneek.mehresh@xxxxxxxxxxxxx>
---
drivers/usb/host/ehci-fsl.c | 54 +++++++++------------------------------------
1 file changed, 10 insertions(+), 44 deletions(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 42628e5..81c8df0 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -42,6 +42,8 @@
#define DRIVER_DESC "Fsl EHCI driver"
#define DRV_NAME "ehci-fsl"

+static struct hc_driver __read_mostly fsl_ehci_hc_driver;
+
/* configure so an HC device and id are always provided */
/* always called with process context; sleeping is OK */

@@ -613,51 +615,9 @@ static int ehci_start_port_reset(struct usb_hcd *hcd, unsigned port)
#define ehci_start_port_reset NULL
#endif /* CONFIG_USB_OTG */

-
-static const struct hc_driver fsl_ehci_hc_driver = {
- .description = hcd_name,
- .product_desc = "Freescale On-Chip EHCI Host Controller",
- .hcd_priv_size = sizeof(struct ehci_fsl),
-
- /*
- * generic hardware linkage
- */
- .irq = ehci_irq,
- .flags = HCD_USB2 | HCD_MEMORY | HCD_BH,
-
- /*
- * basic lifecycle operations
- */
+static struct ehci_driver_overrides ehci_fsl_overrides __initdata = {
+ .extra_priv_size = sizeof(struct ehci_fsl),
.reset = ehci_fsl_setup,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
-
- /*
- * scheduling support
- */
- .get_frame_number = ehci_get_frame,
-
- /*
- * root hub support
- */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
- .start_port_reset = ehci_start_port_reset,
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
};

/*
@@ -709,6 +669,12 @@ static int __init ehci_fsl_init(void)

pr_info(DRV_NAME ": " DRIVER_DESC "\n");

+ ehci_init_driver(&fsl_ehci_hc_driver, &ehci_fsl_overrides);
+
+ fsl_ehci_hc_driver.product_desc =
+ "Freescale On-Chip EHCI Host Controller";
+ fsl_ehci_hc_driver.start_port_reset = ehci_start_port_reset;
+
return platform_driver_register(&ehci_fsl_driver);
}
module_init(ehci_fsl_init);
--
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/