Merge tag 'dma-mapping-5.3' of git://git.infradead.org/users/hch/dma-mapping
[sfrench/cifs-2.6.git] / drivers / usb / host / fotg210-hcd.c
index 0da68df259c8600644db989f247904822002e9b7..77cc36efae9500ea94f7109f5d7abed19812275a 100644 (file)
@@ -10,6 +10,7 @@
  * Most of code borrowed from the Linux-3.7 EHCI driver
  */
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/device.h>
 #include <linux/dmapool.h>
 #include <linux/kernel.h>
@@ -4995,7 +4996,7 @@ static int hcd_fotg210_init(struct usb_hcd *hcd)
        fotg210->command = temp;
 
        /* Accept arbitrarily long scatter-gather lists */
-       if (!(hcd->driver->flags & HCD_LOCAL_MEM))
+       if (!hcd->localmem_pool)
                hcd->self.sg_tablesize = ~0;
        return 0;
 }
@@ -5669,9 +5670,18 @@ static int fotg210_hcd_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id fotg210_of_match[] = {
+       { .compatible = "faraday,fotg210" },
+       {},
+};
+MODULE_DEVICE_TABLE(of, fotg210_of_match);
+#endif
+
 static struct platform_driver fotg210_hcd_driver = {
        .driver = {
                .name   = "fotg210-hcd",
+               .of_match_table = of_match_ptr(fotg210_of_match),
        },
        .probe  = fotg210_hcd_probe,
        .remove = fotg210_hcd_remove,