[PATCH v3] mips: bcm63xx: add support for clk_get_parent()

From: Randy Dunlap
Date: Sun Nov 14 2021 - 11:34:59 EST


BCM63XX selects HAVE_LEGACY_CLK but does not provide/support
clk_get_parent(), so add a simple implementation of that
function so that callers of it will build without errors.

Fixes these build errors:

mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4770_adc_init_clk_div':
ingenic-adc.c:(.text+0xe4): undefined reference to `clk_get_parent'
mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4725b_adc_init_clk_div':
ingenic-adc.c:(.text+0x1b8): undefined reference to `clk_get_parent'

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Cc: Artur Rojek <contact@xxxxxxxxxxxxxx>
Cc: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
Cc: linux-mips@xxxxxxxxxxxxxxx
Cc: Jonathan Cameron <jic23@xxxxxxxxxx>
Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
Cc: linux-iio@xxxxxxxxxxxxxxx
Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
Cc: Russell King <linux@xxxxxxxxxxxxxxx>
Cc: bcm-kernel-feedback-list@xxxxxxxxxxxx
Cc: Jonas Gorski <jonas.gorski@xxxxxxxxx>
---
v1 and v2 were:
[PATCH] iio/adc: ingenic: fix (MIPS) ingenic-adc build errors
Fixes: 1a78daea107d ("IIO: add Ingenic JZ47xx ADC driver.")

arch/mips/bcm63xx/clk.c | 7 +++++++
1 file changed, 7 insertions(+)

--- linux-next-20211112.orig/arch/mips/bcm63xx/clk.c
+++ linux-next-20211112/arch/mips/bcm63xx/clk.c
@@ -381,6 +381,13 @@ void clk_disable(struct clk *clk)

EXPORT_SYMBOL(clk_disable);

+struct clk *clk_get_parent(struct clk *clk)
+{
+ return NULL;
+}
+
+EXPORT_SYMBOL(clk_get_parent);
+
unsigned long clk_get_rate(struct clk *clk)
{
if (!clk)