Re:Re: Re: [PATCH] phy: rockchip: usbdp: Check these parameters only when the corresponding set flags are set

From: Andy Yan
Date: Tue Mar 11 2025 - 08:29:14 EST




Hi Vinod,
At 2025-03-11 19:13:46, "Vinod Koul" <vkoul@xxxxxxxxxx> wrote:
>On 11-03-25, 08:52, Andy Yan wrote:
>
>> Do you mean we should do it like this:
>>
>> static int rk_udphy_dp_phy_configure(struct phy *phy,
>> union phy_configure_opts *opts)
>> {
>> struct rk_udphy *udphy = phy_get_drvdata(phy);
>> struct phy_configure_opts_dp *dp = &opts->dp;
>> u32 i, val, lane;
>> int ret;
>>
>> .............
>> if (dp->set_rate)
>> ret = rk_udphy_dp_phy_verify_link_rate(dp->link_rate);
>> if (dp->set_lanes)
>> ret = rk_udphy_dp_phy_verify_link_lanes(dp->lanes);
>> if (dp->set_voltates)
>> ret = rk_udphy_dp_phy_verify_link_voltate(dp->voltate);
>>
>>
>> Add helper for each of them ?
>
>That would look better for sure

I will do as that in V2.

Thanks

>
>--
>~Vinod