[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8627eb55-e590-4295-a528-9d091fdbb4f1@linux.intel.com>
Date: Fri, 28 Feb 2020 17:20:57 +0800
From: Dilip Kota <eswara.kota@...ux.intel.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Kishon Vijay Abraham I <kishon@...com>,
Rob Herring <robh@...nel.org>, cheol.yong.kim@...el.com,
chuanhua.lei@...ux.intel.com, qi-ming.wu@...el.com,
yixin.zhu@...el.com
Subject: Re: [PATCH v3 3/3] phy: intel: Add driver support for Combophy
On 2/27/2020 5:43 PM, Andy Shevchenko wrote:
> On Thu, Feb 27, 2020 at 9:54 AM Dilip Kota <eswara.kota@...ux.intel.com> wrote:
>
...
>>>> +static int intel_cbphy_iphy_dt_parse(struct intel_combo_phy *cbphy,
>>> dt -> fwnode
>>> Ditto for other similar function names.
>> Sure, it looks appropriate for intel_cbphy_iphy_dt_parse() ->
>> intel_cbphy_iphy_fwnode_parse().
>> Whereas for intel_cbphy_dt_parse() i will keep it unchanged, because it
>> is calling devm_*, devm_platform_*, fwnode_* APIs to traverse dt node.
> How do you know that it will be DT node?
> I can't say it from the function parameters: Is any of them takes of_node?
Got it, All the functions are traversing through device only. I will
change intel_cbphy_dt_parse() to intel_cbphy_fwnode_parse().
(PS: My intention is something different. As the function is fetching
device tree node entries so kept is as *_dt_parse() )
>
>>>> + struct fwnode_handle *fwnode, int idx)
> ...
>
>>>> + struct fwnode_reference_args ref;
>>>> + struct device *dev = cbphy->dev;
>>>> + struct fwnode_handle *fwnode;
>>>> + struct platform_device *pdev;
>>>> + int i, ret;
>>>> + u32 prop;
>>> I guess the following would be better:
>> In the v2 patch, for int i = 0 you mentioned to do initialization at the
>> user, instead of doing at declaration.
>> So i followed the same for "pdev" and "fwnode" which are being used
>> after few lines of the code . It looked good in the perspective of code
>> readability.
> No, it is different. For the loop counter is better to have closer to
> the loop, for the more global thingy like platform device it makes it
> actually harder to find.
> When you do assignments you have to think about the variable meaning
> and scope. Scope is different for loop counter versus the mentioned
> rest.
Understand. I will follow the same and keep a note for future drivers too.
Thanks for detail explanation.
Regards,
Dilip
>> .
Powered by blists - more mailing lists