]> err.no Git - linux-2.6/commitdiff
[PATCH] USB: au1200: EHCI and OHCI fixes
authorDaniel Mack <daniel@caiaq.de>
Fri, 23 Jun 2006 20:36:07 +0000 (21:36 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 Jul 2006 23:03:20 +0000 (16:03 -0700)
I received an DBAU1200 eval kit from AMD a few days ago and tried to
enable the USB2 port, but the current linux-2.6 GIT did not even
compile with CONFIG_SOC_1200, CONFIG_SOC_AU1X00, CONFIG_USB_EHCI and
CONFIG_USB_OHCI set.
Furthermore, in ehci-hcd.c, platform_driver_register() was called with
an improper argument of type 'struct device_driver *' which of course
ended up in a kernel oops. How could that ever have worked on your
machines?

Anyway, here's a trivial patch that makes the USB subsystem working
on my board for both OHCI and EHCI.
It also removes the /* FIXME use "struct platform_driver" */.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ohci-au1xxx.c

index d66867aa527e5630144cd879d40717fe68778a62..26ed757d22a66139ea500eaddc1130f4eeb2baf4 100644 (file)
@@ -41,8 +41,6 @@
 #endif
 #define USBH_DISABLE      (USB_MCFG_EBMEN | USB_MCFG_EMEMEN)
 
-#endif                         /* Au1200 */
-
 extern int usb_disabled(void);
 
 /*-------------------------------------------------------------------------*/
@@ -107,9 +105,9 @@ int usb_ehci_au1xxx_probe(const struct hc_driver *driver,
 
        /* Au1200 AB USB does not support coherent memory */
        if (!(read_c0_prid() & 0xff)) {
-               pr_info("%s: this is chip revision AB!\n", dev->dev.name);
+               pr_info("%s: this is chip revision AB!\n", dev->name);
                pr_info("%s: update your board or re-configure the kernel\n",
-                       dev->dev.name);
+                       dev->name);
                return -ENODEV;
        }
 #endif
@@ -228,9 +226,8 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
 
 /*-------------------------------------------------------------------------*/
 
-static int ehci_hcd_au1xxx_drv_probe(struct device *dev)
+static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
        struct usb_hcd *hcd = NULL;
        int ret;
 
@@ -243,10 +240,9 @@ static int ehci_hcd_au1xxx_drv_probe(struct device *dev)
        return ret;
 }
 
-static int ehci_hcd_au1xxx_drv_remove(struct device *dev)
+static int ehci_hcd_au1xxx_drv_remove(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct usb_hcd *hcd = dev_get_drvdata(dev);
+       struct usb_hcd *hcd = platform_get_drvdata(pdev);
 
        usb_ehci_au1xxx_remove(hcd, pdev);
        return 0;
@@ -269,12 +265,13 @@ static int ehci_hcd_au1xxx_drv_resume(struct device *dev)
 }
 */
 MODULE_ALIAS("au1xxx-ehci");
-/* FIXME use "struct platform_driver" */
-static struct device_driver ehci_hcd_au1xxx_driver = {
-       .name = "au1xxx-ehci",
-       .bus = &platform_bus_type,
+static struct platform_driver ehci_hcd_au1xxx_driver = {
        .probe = ehci_hcd_au1xxx_drv_probe,
        .remove = ehci_hcd_au1xxx_drv_remove,
        /*.suspend      = ehci_hcd_au1xxx_drv_suspend, */
        /*.resume       = ehci_hcd_au1xxx_drv_resume, */
+       .driver = {
+               .name = "au1xxx-ehci",
+               .bus = &platform_bus_type
+       }
 };
index f7a975d5db097757965b758baf14612c86b72f62..822914e2f43bbbe80a31616da47f40d3dfc06a4a 100644 (file)
@@ -110,6 +110,7 @@ static void au1xxx_start_ohc(struct platform_device *dev)
 
        printk(KERN_DEBUG __FILE__
        ": Clock to USB host has been enabled \n");
+#endif
 }
 
 static void au1xxx_stop_ohc(struct platform_device *dev)