[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190607181725.0086E20868@mail.kernel.org>
Date: Fri, 07 Jun 2019 11:17:24 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Chen-Yu Tsai <wens@...nel.org>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Michael Turquette <mturquette@...libre.com>
Cc: Chen-Yu Tsai <wens@...e.org>, linux-arm-kernel@...ts.infradead.org,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/25] clk: Add CLK_HW_INIT_* macros using .parent_hws
Quoting Chen-Yu Tsai (2019-05-20 01:03:58)
> A special CLK_HW_INIT_HWS macro is included, which takes an array of
> struct clk_hw *, but sets .num_parents to 1. This variant is to allow
> the reuse of the array, instead of having a compound literal allocated
> for each clk sharing the same parent.
>
> Signed-off-by: Chen-Yu Tsai <wens@...e.org>
[...]
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index bb6118f79784..0c241b43a802 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -904,6 +904,24 @@ extern struct of_device_id __clk_of_table;
> .ops = _ops, \
> })
>
> +#define CLK_HW_INIT_HW(_name, _parent, _ops, _flags) \
> + (&(struct clk_init_data) { \
> + .flags = _flags, \
> + .name = _name, \
> + .parent_hws = (const struct clk_hw*[]) { _parent }, \
> + .num_parents = 1, \
> + .ops = _ops, \
> + })
> +
> +#define CLK_HW_INIT_HWS(_name, _parent, _ops, _flags) \
Minor nitpick, please add a comment here to indicate that this is here
to share the same compound literal between multiple clks using the same
parent.
> + (&(struct clk_init_data) { \
> + .flags = _flags, \
> + .name = _name, \
> + .parent_hws = _parent, \
> + .num_parents = 1, \
> + .ops = _ops, \
> + })
Powered by blists - more mailing lists