USB: ohci-platform: Move platform_data checks into the probe function
authorKevin Cernekee <cernekee@gmail.com>
Sat, 11 Oct 2014 18:10:49 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Nov 2014 23:38:17 +0000 (15:38 -0800)
This puts all of the platform_data checks in the same place, and removes
the need for a custom drv->reset() callback.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-platform.c

index 6fb03f88b51d949481f6f477fceed17f2bf0af01..7793c3cfcf1f662efd43d09416525bc113e4ec0e 100644 (file)
@@ -43,20 +43,6 @@ struct ohci_platform_priv {
 
 static const char hcd_name[] = "ohci-platform";
 
-static int ohci_platform_reset(struct usb_hcd *hcd)
-{
-       struct platform_device *pdev = to_platform_device(hcd->self.controller);
-       struct usb_ohci_pdata *pdata = dev_get_platdata(&pdev->dev);
-       struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-
-       if (pdata->no_big_frame_no)
-               ohci->flags |= OHCI_QUIRK_FRAME_NO;
-       if (pdata->num_ports)
-               ohci->num_ports = pdata->num_ports;
-
-       return ohci_setup(hcd);
-}
-
 static int ohci_platform_power_on(struct platform_device *dev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(dev);
@@ -110,7 +96,6 @@ static struct hc_driver __read_mostly ohci_platform_hc_driver;
 
 static const struct ohci_driver_overrides platform_overrides __initconst = {
        .product_desc =         "Generic Platform OHCI controller",
-       .reset =                ohci_platform_reset,
        .extra_priv_size =      sizeof(struct ohci_platform_priv),
 };
 
@@ -218,6 +203,10 @@ static int ohci_platform_probe(struct platform_device *dev)
                ohci->flags |= OHCI_QUIRK_BE_DESC;
        if (pdata->big_endian_mmio)
                ohci->flags |= OHCI_QUIRK_BE_MMIO;
+       if (pdata->no_big_frame_no)
+               ohci->flags |= OHCI_QUIRK_FRAME_NO;
+       if (pdata->num_ports)
+               ohci->num_ports = pdata->num_ports;
 
 #ifndef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO
        if (ohci->flags & OHCI_QUIRK_BE_MMIO) {