Re: [PATCH net-next 2/2] net: mv643xx: fix wrong devm_clk_get usage

From: Andrew Lunn
Date: Mon Sep 30 2024 - 16:43:50 EST


On Mon, Sep 30, 2024 at 01:29:51PM -0700, Rosen Penev wrote:
> This clock should be optional. In addition, PTR_ERR can be -EPROBE_DEFER
> in which case it should return.
>
> devm_clk_get_optional_enabled also allows removing explicit clock enable
> and disable calls.

mv643xx_eth was one of the early drivers to get converted to common
clock framework, and then devm. Some of the niceties of _optional, and
_enable did not exist back then. So the logic may seem a bit odd
nowadays.

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew