Skip to content

Commit 47b0eeb

Browse files
committed
clk: Deprecate CLK_IS_ROOT
We don't use CLK_IS_ROOT but in a few places in the common clk framework core. Let's replace those checks with a check for the number of parents a clk has instead of the flag, freeing up one flag for something else. We don't remove the flag yet so that things keep building, but we'll remove it once all drivers have removed their flag usage. Signed-off-by: Stephen Boyd <[email protected]>
1 parent 14b04f2 commit 47b0eeb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/clk/clk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static unsigned long clk_core_get_rate_nolock(struct clk_core *core)
385385

386386
ret = core->rate;
387387

388-
if (core->flags & CLK_IS_ROOT)
388+
if (!core->num_parents)
389389
goto out;
390390

391391
if (!core->parent)
@@ -2351,7 +2351,7 @@ static int __clk_core_init(struct clk_core *core)
23512351
/*
23522352
* Populate core->parent if parent has already been __clk_init'd. If
23532353
* parent has not yet been __clk_init'd then place clk in the orphan
2354-
* list. If clk has set the CLK_IS_ROOT flag then place it in the root
2354+
* list. If clk doesn't have any parents then place it in the root
23552355
* clk list.
23562356
*
23572357
* Every time a new clk is clk_init'd then we walk the list of orphan
@@ -2362,7 +2362,7 @@ static int __clk_core_init(struct clk_core *core)
23622362
hlist_add_head(&core->child_node,
23632363
&core->parent->children);
23642364
core->orphan = core->parent->orphan;
2365-
} else if (core->flags & CLK_IS_ROOT) {
2365+
} else if (!core->num_parents) {
23662366
hlist_add_head(&core->child_node, &clk_root_list);
23672367
core->orphan = false;
23682368
} else {

include/linux/clk-provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define CLK_SET_PARENT_GATE BIT(1) /* must be gated across re-parent */
2626
#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
2727
#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
28-
#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
28+
#define CLK_IS_ROOT BIT(4) /* Deprecated: Don't use */
2929
#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
3030
#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
3131
#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */

0 commit comments

Comments
 (0)