On 18.05.21 13:49, Sascha Hauer wrote:
> The Linux version of the clk divider exports a clk_divider_ro_ops. Do
> the same for barebox.

Is it much hassle to make these const from the get-go?

> 
> Signed-off-by: Sascha Hauer <[email protected]>
> ---
>  drivers/clk/clk-divider.c | 4 ++++
>  include/linux/clk.h       | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
> index edbba941b7..080aaa58a2 100644
> --- a/drivers/clk/clk-divider.c
> +++ b/drivers/clk/clk-divider.c
> @@ -302,6 +302,10 @@ struct clk_ops clk_divider_ops = {
>       .round_rate = clk_divider_round_rate,
>  };
>  
> +struct clk_ops clk_divider_ro_ops = {
> +     .recalc_rate = clk_divider_recalc_rate,
> +};
> +
>  struct clk *clk_divider_alloc(const char *name, const char *parent,
>                             unsigned clk_flags, void __iomem *reg, u8 shift,
>                             u8 width, unsigned div_flags)
> diff --git a/include/linux/clk.h b/include/linux/clk.h
> index 654845023a..d0bcdd7ac3 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -451,6 +451,7 @@ struct clk_divider {
>  #define CLK_MUX_READ_ONLY            (1 << 3) /* mux can't be changed */
>  
>  extern struct clk_ops clk_divider_ops;
> +extern struct clk_ops clk_divider_ro_ops;
>  
>  unsigned long divider_recalc_rate(struct clk *clk, unsigned long parent_rate,
>               unsigned int val,
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to