Re: [PATCH 5/5 v8] usb: musb: da8xx: Add DT support for the DA8xx driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

On 07.03.2016 14:29, Sergei Shtylyov wrote:
Hello.

On 3/7/2016 2:20 PM, Petr Kulhavy wrote:

@@ -544,17 +643,25 @@ static int da8xx_probe(struct platform_device *pdev)
      pinfo.data = pdata;
      pinfo.size_data = sizeof(*pdata);

+    ret = regulator_enable(glue->vbus_supply);

What does this achieve with a regulator that can't be explicitly controlled?


If this is a _real_ regulator, then it needs to be enabled by somebody, doesn't it?

+    if (ret) {
+        dev_err(&pdev->dev, "failed to enable power: %d\n", ret);
+        goto err6;
+    }
+
      glue->musb = musb = platform_device_register_full(&pinfo);
      if (IS_ERR(musb)) {
          ret = PTR_ERR(musb);
dev_err(&pdev->dev, "failed to register musb device: %d\n", ret);
-        goto err6;
+        goto err7;
      }

      return 0;
+err7:
+    usb_phy_generic_unregister(glue->phy);

  err6:
-    usb_phy_generic_unregister(glue->phy);
+    regulator_disable(glue->vbus_supply);

How's that? Aren't you envaling Vbus regulator *after* registering PHY?

No, as you can see just a few lines above in the patch.

[...]
@@ -582,11 +690,20 @@ static int da8xx_remove(struct platform_device *pdev)
      return 0;
  }

+static const struct of_device_id da8xx_id_table[] = {
+    {
+        .compatible = "ti,da830-musb",
+    },
+    {},
+};
+MODULE_DEVICE_TABLE(of, da8xx_id_table);
+
  static struct platform_driver da8xx_driver = {
      .probe        = da8xx_probe,
      .remove        = da8xx_remove,
      .driver        = {
          .name    = "musb-da8xx",
+        .of_match_table = of_match_ptr(da8xx_id_table),

   Doesn't this cause a warning about in non-DT case?

No, the of_match_table is defined independent of the CONFIG_OF.

Regards
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux