Thread (14 messages) 14 messages, 6 authors, 2018-10-24

Re: [PATCH V2 5/6] usb: ehci: Add new EHCI driver for Broadcom STB SoC's

From: Arnd Bergmann <arnd@arndb.de>
Date: 2018-10-24 07:15:01
Also in: linux-usb, lkml

On Wed, Oct 17, 2018 at 11:30 PM Al Cooper [off-list ref] wrote:
+
+static int ehci_brcm_probe(struct platform_device *pdev)
+{
+       struct usb_hcd *hcd;
+       struct resource *res_mem;
+       struct brcm_priv *priv;
+       int irq;
+       int err;
+
+       if (usb_disabled())
+               return -ENODEV;
+
+       err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       if (err)
+               return err;
You should never use "dma_coerce_mask_and_coherent" in new code. Make sure that
the DT is correct and call dma_set_mask_and_coherent() instead.
+#ifdef CONFIG_OF
+static const struct of_device_id brcm_ehci_of_match[] = {
+       { .compatible = "brcm,bcm7445-ehci", },
+       {}
+};
+
+MODULE_DEVICE_TABLE(of, brcm_ehci_of_match);
+#endif /* CONFIG_OF */
+
+static struct platform_driver ehci_brcm_driver = {
+       .probe          = ehci_brcm_probe,
+       .remove         = ehci_brcm_remove,
+       .shutdown       = usb_hcd_platform_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = "ehci-brcm",
+               .pm     = &ehci_brcm_pm_ops,
+               .of_match_table = of_match_ptr(brcm_ehci_of_match),
+       }
+};
You won't ever use this driver without CONFIG_OF, so just remove the #ifdef and
of_match_ptr() wrapper here. It will still build fine without CONFIG_OF.

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help