[PATCH 05/10] phy: rockchip: naneng-combphy: Use syscon_regmap_lookup_by_phandle

Kever Yang kever.yang at rock-chips.com
Sat Aug 30 18:46:25 CEST 2025


On 2025/7/22 06:07, Jonas Karlman wrote:
> Change to use syscon_regmap_lookup_by_phandle() helper instead of
> finding the syscon udevice and making a call to syscon_get_regmap().
>
> No runtime change is expected with this simplication.
>
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>

Thanks,
- Kever
> ---
>   .../phy/rockchip/phy-rockchip-naneng-combphy.c  | 17 +++++++----------
>   1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
> index f246c8db2d6c..7f107a11606b 100644
> --- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
> @@ -175,22 +175,19 @@ static const struct phy_ops rockchip_combphy_ops = {
>   static int rockchip_combphy_parse_dt(struct udevice *dev,
>   				     struct rockchip_combphy_priv *priv)
>   {
> -	struct udevice *syscon;
>   	int ret;
>   
> -	ret = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "rockchip,pipe-grf", &syscon);
> -	if (ret) {
> -		dev_err(dev, "failed to find peri_ctrl pipe-grf regmap");
> -		return ret;
> +	priv->pipe_grf = syscon_regmap_lookup_by_phandle(dev, "rockchip,pipe-grf");
> +	if (IS_ERR(priv->pipe_grf)) {
> +		dev_err(dev, "failed to find peri_ctrl pipe-grf regmap\n");
> +		return PTR_ERR(priv->pipe_grf);
>   	}
> -	priv->pipe_grf = syscon_get_regmap(syscon);
>   
> -	ret = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "rockchip,pipe-phy-grf", &syscon);
> -	if (ret) {
> +	priv->phy_grf = syscon_regmap_lookup_by_phandle(dev, "rockchip,pipe-phy-grf");
> +	if (IS_ERR(priv->phy_grf)) {
>   		dev_err(dev, "failed to find peri_ctrl pipe-phy-grf regmap\n");
> -		return ret;
> +		return PTR_ERR(priv->phy_grf);
>   	}
> -	priv->phy_grf = syscon_get_regmap(syscon);
>   
>   	ret = clk_get_by_index(dev, 0, &priv->ref_clk);
>   	if (ret) {


More information about the U-Boot mailing list