From: Dilip Kota <eswara.kota@linux.intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
devicetree <devicetree@vger.kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Rob Herring <robh@kernel.org>,
cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com,
qi-ming.wu@intel.com, yixin.zhu@intel.com
Subject: Re: [PATCH v3 3/3] phy: intel: Add driver support for Combophy
Date: Fri, 28 Feb 2020 17:20:57 +0800 [thread overview]
Message-ID: <8627eb55-e590-4295-a528-9d091fdbb4f1@linux.intel.com> (raw)
In-Reply-To: <CAHp75VfJHvtLBueHJnU6xEuSrehiXH4Pvj880TqpyDBBnx1RuQ@mail.gmail.com>
On 2/27/2020 5:43 PM, Andy Shevchenko wrote:
> On Thu, Feb 27, 2020 at 9:54 AM Dilip Kota <eswara.kota@linux.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
>> .
prev parent reply other threads:[~2020-02-28 9:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 10:09 [PATCH v3 0/3] Add Intel ComboPhy driver Dilip Kota
2020-02-26 10:09 ` [PATCH v3 1/3] mfd: syscon: Add fwnode_to_regmap Dilip Kota
2020-02-26 10:09 ` [PATCH v3 2/3] dt-bindings: phy: Add YAML schemas for Intel Combophy Dilip Kota
2020-02-26 10:09 ` [PATCH v3 3/3] phy: intel: Add driver support for Combophy Dilip Kota
2020-02-26 14:41 ` Andy Shevchenko
2020-02-26 14:45 ` Andy Shevchenko
2020-02-27 7:52 ` Dilip Kota
2020-02-27 9:43 ` Andy Shevchenko
2020-02-28 9:20 ` Dilip Kota [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8627eb55-e590-4295-a528-9d091fdbb4f1@linux.intel.com \
--to=eswara.kota@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=cheol.yong.kim@intel.com \
--cc=chuanhua.lei@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qi-ming.wu@intel.com \
--cc=robh@kernel.org \
--cc=yixin.zhu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.