Skip to contentSkip to conversation

clk: mediatek: fix clk-gate flag setting

PATCH Applied Weiyi Lu 3 participants 3 messages Apr 12, 2019

Subsystems (3)
lore
Share & tools
lore

Weiyi Lu

author
#0 lore raw

PATCH 1/1 clk: mediatek: fix clk-gate flag setting

CLK_SET_RATE_PARENT would be dropped.
Merge two flag setting together to correct the error.

Fixes 5a1cc4c27ad2 ("clk: mediatek: Add flags to mtk_gate")
---
 drivers/clk/mediatek/clk-gate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/mediatek/clk-gate.c +1 -2
index 9628d4e7690b..85daf826619a 100644
@@ -169,11 +169,10 @@ struct clk *mtk_clk_register_gate(
 		return ERR_PTR(-ENOMEM);
 
 	init.name = name;
-	init.flags = CLK_SET_RATE_PARENT;
+	init.flags = flags | CLK_SET_RATE_PARENT;
 	init.parent_names = parent_name ? &parent_name : NULL;
 	init.num_parents = parent_name ? 1 : 0;
 	init.ops = ops;
-	init.flags = flags;
 
 	cg->regmap = regmap;
 	cg->set_ofs = set_ofs;
Signature · 1 line
2.18.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Weiyi Lu

CLK_SET_RATE_PARENT would be dropped.
Merge two flag setting together to correct the error.

Fixes 5a1cc4c27ad2 ("clk: mediatek: Add flags to mtk_gate")

Good catch.

Quoted 22 lines
---
 drivers/clk/mediatek/clk-gate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/mediatek/clk-gate.c +1 -2
index 9628d4e7690b..85daf826619a 100644
@@ -169,11 +169,10 @@ struct clk *mtk_clk_register_gate(
 		return ERR_PTR(-ENOMEM);
 
 	init.name = name;
-	init.flags = CLK_SET_RATE_PARENT;
+	init.flags = flags | CLK_SET_RATE_PARENT;
 	init.parent_names = parent_name ? &parent_name : NULL;
 	init.num_parents = parent_name ? 1 : 0;
 	init.ops = ops;
-	init.flags = flags;
 
 	cg->regmap = regmap;
 	cg->set_ofs = set_ofs;