mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-01 00:50:43 +09:00
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 <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
26f4fd1cb4
commit
2e242f5f43
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user