Thread (11 messages) 11 messages, 6 authors, 2014-01-20

Re: [PATCH v4 2/3] ata: ahci_platform: Manage SATA PHY

From: Roger Quadros <hidden>
Date: 2014-01-09 11:37:56
Also in: linux-ide, lkml

On 01/09/2014 04:50 PM, Sergei Shtylyov wrote:
On 09-01-2014 14:56, Roger Quadros wrote:
quoted
From: Balaji T K <redacted>
quoted
Some platforms have a PHY hooked up to the
SATA controller. The PHY needs to be initialized
and powered up for SATA to work. We do that
using the PHY framework.
quoted
[Roger Q] Cleaned up.
quoted
CC: Tejun Heo <tj@kernel.org>
Signed-off-by: Balaji T K <redacted>
Signed-off-by: Roger Quadros <redacted>
[...]
quoted
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index d5ced13..b476642 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -142,6 +142,39 @@ static int ahci_probe(struct platform_device *pdev)
          }
      }

+    hpriv->phy = devm_phy_get(dev, "sata-phy");
+    if (IS_ERR(hpriv->phy)) {
+        rc = PTR_ERR(hpriv->phy);
+        switch (rc) {
+        case -ENODEV:
+        case -ENOSYS:
+            /* continue normally */
+            hpriv->phy = NULL;
+            break;
+
+        case -EPROBE_DEFER:
+            goto disable_unprepare_clk;
+            break;
   Well, well, *break* after *goto*? :-)
I know it is pointless functionally, but it is just my preference
aesthetically.

Is it much of an issue if left as is?

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