From 2e242f5f43ed9945d4b9005672b654d49360e43a Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Mon, 25 Feb 2019 08:14:36 +0000 Subject: [PATCH] net: macb: Fix clk API usage for RISC-V systems Don't fail in macb_enable_clk() if clk_enable() returns -ENOSYS because we get -ENOSYS for fixed-rate clocks. Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- drivers/net/macb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index c9ee22279a..0254e211e6 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -1061,14 +1061,13 @@ static int macb_enable_clk(struct udevice *dev) return -EINVAL; /* - * Zynq clock driver didn't support for enable or disable - * clock. Hence, clk_enable() didn't apply for Zynq + * If clock driver didn't support enable or disable then + * we get -ENOSYS from clk_enable(). To handle this, we + * don't fail for ret == -ENOSYS. */ -#ifndef CONFIG_MACB_ZYNQ ret = clk_enable(&clk); - if (ret) + if (ret && ret != -ENOSYS) return ret; -#endif clk_rate = clk_get_rate(&clk); if (!clk_rate) -- 2.25.1