Skip to contentSkip to conversation

usb: uhci: Add clk support to uhci-platform

PATCH Superseded Benjamin Herrenschmidt 1 participant 1 message Jan 12, 2018 USB

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: uhci: Add clk support to uhci-platform

Quoted 5 lines · Alan Stern

As Sergei mentioned, please be consistent in the use of tabs vs. spaces.

Do you have to worry about EPROBE_DEFER errors at any point?

I don't think so, not on the SoC I'm using but it might be worthwhile adding support for it just in case...

Quoted 13 lines

Review

Quoted 12 lines
(quoted diff) +8 -0
+     if (uhci->clk) {
+             ret = clk_prepare_enable(uhci->clk);
+             if (ret) {
+                     dev_err(&pdev->dev, "Error couldn't enable clock (%d)\n", ret);
+                     goto err_rmr;
+             }
+        }
+
       ret = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED);
       if (ret)
               goto err_rmr;
Quoted 1 line

This error path needs to call clk_disable_unprepare.

Yeah ok.

Quoted 6 lines
Quoted 6 lines
(quoted diff) +1 -0
@@ -135,7 +150,10 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
  static int uhci_hcd_platform_remove(struct platform_device *pdev)
  {
       struct usb_hcd *hcd = platform_get_drvdata(pdev);
+     struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 
Quoted 6 lines

Review static int uhci_hcd_platform_probe(struct platform_device *pdev) · line 158

Quoted 4 lines
(quoted diff) +2 -0
+     if (uhci->clk)
+             clk_disable_unprepare(uhci->clk);
       usb_remove_hcd(hcd);
       usb_put_hcd(hcd);

Alan Stern

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html