Re: [PATCH] mips: bcm63xx: add support for clk_set_parent()

From: Jonathan Cameron
Date: Wed Dec 29 2021 - 11:34:41 EST


On Tue, 28 Dec 2021 16:05:53 -0800
Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:

> The MIPS BMC63XX subarch does not provide/support clk_set_parent().
> This causes build errors in a few drivers, so add a simple implementation
> of that function so that callers of it will build without errors.
>
> Fixes these build errors:
>
> ERROR: modpost: "clk_set_parent" [sound/soc/jz4740/snd-soc-jz4740-i2s.ko] undefined!
> ERROR: modpost: "clk_set_parent" [sound/soc/atmel/snd-soc-atmel-i2s.ko] undefined!
>
> Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs." )
> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Hi Randy,

As with the other one, perhaps consider a WARN_ON()
With or without that FWIW

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

> ---
> arch/mips/bcm63xx/clk.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> --- linux-next-20211224.orig/arch/mips/bcm63xx/clk.c
> +++ linux-next-20211224/arch/mips/bcm63xx/clk.c
> @@ -387,6 +387,12 @@ struct clk *clk_get_parent(struct clk *c
> }
> EXPORT_SYMBOL(clk_get_parent);
>
> +int clk_set_parent(struct clk *clk, struct clk *parent)
> +{
> + return 0;
> +}
> +EXPORT_SYMBOL(clk_set_parent);
> +
> unsigned long clk_get_rate(struct clk *clk)
> {
> if (!clk)