diff mbox series

phy: rockchip: handle clock without enable function

Message ID 20221206124855.2836827-1-john@metanate.com
State Accepted
Commit b5194c22585d1f3869b2126a87dabecb5ef2627e
Delegated to: Kever Yang
Headers show
Series phy: rockchip: handle clock without enable function | expand

Commit Message

John Keeping Dec. 6, 2022, 12:48 p.m. UTC
If a clock doesn't supply the enable hook, clk_enable() will return
-ENOSYS.  In this case the clock is always enabled so there is no error
and the phy initialisation should continue.

Signed-off-by: John Keeping <john@metanate.com>
---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kever Yang Dec. 18, 2022, 10:22 a.m. UTC | #1
On 2022/12/6 20:48, John Keeping wrote:
> If a clock doesn't supply the enable hook, clk_enable() will return
> -ENOSYS.  In this case the clock is always enabled so there is no error
> and the phy initialisation should continue.
>
> Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 62b8ba3a4a..b32a498ea7 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -119,7 +119,7 @@ static int rockchip_usb2phy_init(struct phy *phy)
>   	int ret;
>   
>   	ret = clk_enable(&priv->phyclk);
> -	if (ret) {
> +	if (ret && ret != -ENOSYS) {
>   		dev_err(phy->dev, "failed to enable phyclk (ret=%d)\n", ret);
>   		return ret;
>   	}
diff mbox series

Patch

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 62b8ba3a4a..b32a498ea7 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -119,7 +119,7 @@  static int rockchip_usb2phy_init(struct phy *phy)
 	int ret;
 
 	ret = clk_enable(&priv->phyclk);
-	if (ret) {
+	if (ret && ret != -ENOSYS) {
 		dev_err(phy->dev, "failed to enable phyclk (ret=%d)\n", ret);
 		return ret;
 	}