Skip to contentSkip to conversation

clk: socfpga: Remove check for "reg" property in socfpga_clk_init

PATCH New dinguyen at altera.com 2 participants 2 messages Oct 15, 2013 – Oct 22, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: socfpga: Remove check for "reg" property in socfpga_clk_init

From: Dinh Nguyen <[email protected]>

The function socfpga_clk_init() can support clocks that do not have a divider register, but a fixed-divider that can be read from DTS. Therefore, the "reg" property is not a failing condition for socfpga_clk_init().

Cc Mike Turquette <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
---
 drivers/clk/socfpga/clk.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clk/socfpga/clk.c +1 -3
index 5bb848c..7f846bf 100644
@@ -121,9 +121,7 @@ static __init struct clk *socfpga_clk_init(struct device_node *node,
 	int rc;
 	u32 fixed_div;
 
-	rc = of_property_read_u32(node, "reg", &reg);
-	if (WARN_ON(rc))
-		return NULL;
+	of_property_read_u32(node, "reg", &reg);
 
 	socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL);
 	if (WARN_ON(!socfpga_clk))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 clk: socfpga: Remove check for "reg" property in socfpga_clk_init

Hi Mike,

Quoted 18 lines · dinguyen at altera.com

From: Dinh Nguyen <[email protected]>

The function socfpga_clk_init() can support clocks that do not have a divider register, but a fixed-divider that can be read from DTS. Therefore, the "reg" property is not a failing condition for socfpga_clk_init().

Cc Mike Turquette <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
---
  drivers/clk/socfpga/clk.c |    4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/clk/socfpga/clk.c +0 -0
index 5bb848c..7f846bf 100644

drivers/clk/socfpga/clk.c static __init struct clk *socfpga_clk_init(struct device_node *node, · line 127

Quoted 10 lines
drivers/clk/socfpga/clk.c +1 -3
@@ -121,9 +121,7 @@ static __init struct clk *socfpga_clk_init(struct device_node *node,
  	int rc;
  	u32 fixed_div;
 
-	rc = of_property_read_u32(node, "reg", &reg);
-	if (WARN_ON(rc))
-		return NULL;
+	of_property_read_u32(node, "reg", &reg);
 
  	socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL);
  	if (WARN_ON(!socfpga_clk))

Was wondering if you have gotten a chance to review this patch?

Thanks,
Dinh