[RFC 1/5] clk: Increment assigned-clocks index for empty phandles

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

 




If the assigned-clocks property contains an empty phandle, skip the index
rather than trying it over on the next iteration (with an related clock
rate related to another clock).

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
---
 drivers/clk/clk-conf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
index 49819b546134..7b7113d86875 100644
--- a/drivers/clk/clk-conf.c
+++ b/drivers/clk/clk-conf.c
@@ -91,10 +91,12 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
 					"#clock-cells",	index, &clkspec);
 			if (rc < 0) {
 				/* skip empty (null) phandles */
-				if (rc == -ENOENT)
+				if (rc == -ENOENT) {
+					index++;
 					continue;
-				else
+				} else {
 					return rc;
+				}
 			}
 			if (clkspec.np == node && !clk_supplier)
 				return 0;
-- 
2.11.0

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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux