From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel Date: Mon, 17 Dec 2018 17:21:42 +0530 Subject: [U-Boot] [PATCH 2/3] net: macb: Fix clk API usage for RISC-V systems In-Reply-To: <20181217115143.18373-1-anup@brainfault.org> References: <20181217115143.18373-1-anup@brainfault.org> Message-ID: <20181217115143.18373-3-anup@brainfault.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Anup Patel This patch does following fixes in MACB ethernet driver for using it on RISC-V systems (particularly QEMU sifive_u machine): 1. asm/arch/clk.h is not available on RISC-V port so include it only for non-RISC-V systems. 2. 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 --- drivers/net/macb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 94c89c762b..9a06b523cc 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -38,7 +38,9 @@ #include #include #include +#ifndef CONFIG_RISCV #include +#endif #include #include "macb.h" @@ -1066,7 +1068,7 @@ static int macb_enable_clk(struct udevice *dev) */ #ifndef CONFIG_MACB_ZYNQ ret = clk_enable(&clk); - if (ret) + if (ret && ret != -ENOSYS) return ret; #endif -- 2.17.1