Thread (29 messages) 29 messages, 7 authors, 2010-08-03
STALE5827d

[PATCH v4] GPIO PL061: Adding Clk framework support

From: Kevin Wells <hidden>
Date: 2010-07-29 23:22:58

quoted hunk ↗ jump to hunk
 /*
  * These are the device model conversion veneers; they convert the
  * device model structures to our more specific structures.
@@ -130,17 +155,33 @@ static int amba_probe(struct device *dev)
 {
 	struct amba_device *pcdev = to_amba_device(dev);
 	struct amba_driver *pcdrv = to_amba_driver(dev->driver);
-	struct amba_id *id;
+	struct amba_id *id = amba_lookup(pcdrv->id_table, pcdev);
+	int ret;

-	id = amba_lookup(pcdrv->id_table, pcdev);
+	do {
+		ret = amba_get_enable_pclk(pcdev);
+		if (ret)
+			break;
+
+		ret = pcdrv->probe(pcdev, id);
+		if (ret == 0)
+			break;

-	return pcdrv->probe(pcdev, id);
+		amba_put_disable_pclk(pcdev);
Should the AMBA clock be disabled if the probe() fails?
+	} while (0);
+
+	return ret;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help