net: ethernet: stmmac: dwmac-rk: rework optional clock handling
authorSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 7 Apr 2023 16:11:28 +0000 (18:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Apr 2023 08:21:27 +0000 (09:21 +0100)
commitea449f7fa0bf3fcd02e04a770b9ff707bf5e8f96
tree3bf60b78d8a6cb84d7ec0ccaa9b188f0ff3f2d27
parentbbda0f0d151cc05b830bb41ed65c4dc2b616c21e
net: ethernet: stmmac: dwmac-rk: rework optional clock handling

The clock requesting code is quite repetitive. Fix this by requesting
the clocks via devm_clk_bulk_get_optional. The optional variant has been
used, since this is effectively what the old code did. The exact clocks
required depend on the platform and configuration. As a side effect
this change adds correct -EPROBE_DEFER handling.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 7ad269ea1a2b ("GMAC: add driver for Rockchip RK3288 SoCs integrated GMAC")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c