From: "Ramuthevar, Vadivel MuruganX" <vadivel.muruganx.ramuthevar@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: linux-kernel@vger.kernel.org, balbi@kernel.org, robh@kernel.org,
p.zabel@pengutronix.de, gregkh@linuxfoundation.org,
devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
cheol.yong.kim@intel.com, qi-ming.wu@intel.com,
yin1.li@intel.com
Subject: Re: [PATCH v3 2/2] usb: phy: Add USB3 PHY support for Intel LGM SoC
Date: Wed, 17 Jun 2020 08:10:55 +0800 [thread overview]
Message-ID: <530dc44b-59d7-7ecd-4ec9-fd13f5f0e129@linux.intel.com> (raw)
In-Reply-To: <20200612131822.GG2428291@smile.fi.intel.com>
Hi Andy,
Thank you very much for the review comments and your time...
On 12/6/2020 9:18 pm, Andy Shevchenko wrote:
> On Fri, Jun 12, 2020 at 10:59:41AM +0800, Ramuthevar,Vadivel MuruganX wrote:
>> From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar@linux.intel.com>
>>
>> Add support for USB PHY on Intel LGM SoC.
>
> Thank you for an update, looks pretty much good, my comments below.
Sure, will update.
>
> ...
>
>> +static int get_flipped(struct tca_apb *ta, bool *flipped)
>> +{
>> + union extcon_property_value property;
>> + int ret;
>> +
>> + ret = extcon_get_property(ta->phy.edev, EXTCON_USB_HOST,
>> + EXTCON_PROP_USB_TYPEC_POLARITY, &property);
>> + if (ret) {
>
>> + dev_err(ta->phy.dev, "no polarity property from extcon\n");
>
> (1)
Noted.
>
>> + return ret;
>> + }
>> +
>> + *flipped = property.intval;
>> +
>> + return ret;
>> +}
>
> ...
>
>> + ret = get_flipped(ta, &flipped);
>> + if (ret)
>> + dev_err(ta->phy.dev, "no polarity property from extcon\n");
>
> You already has a message in (1). You should decide which one to leave.
>
> But note, if it's a fatal error, you have to return here, otherwise, if you
> decide to leave message here, it should be not on error level.
Agreed!, let double and update as per your suggestion if it is fatal error.
>
>> + connected = extcon_get_state(ta->phy.edev, EXTCON_USB_HOST);
>> + if (connected == ta->connected)
>> + return;
>> +
>> + ta->connected = connected;
>> + if (connected) {
>> + val = TCPC_VALID | FIELD_PREP(TCPC_MUX_CTL, MUX_USB);
>> + if (flipped)
>> + val |= TCPC_FLIPPED;
>> + dev_info(ta->phy.dev, "connected%s\n", flipped ? " flipped" : "");
>> + } else {
>> + val = TCPC_DISCONN;
>> + dev_info(ta->phy.dev, "disconnected\n");
>> + }
>> +
>> + writel(val, ta->phy.io_priv + TCPC_OFFSET);
>> +
>
>> + if (ta->phy.set_vbus(&ta->phy, connected))
>> + dev_err(ta->phy.dev, "failed to set VBUS\n");
>
> Please, split it to
> ret = ...;
Noted, will update.
> if (ret)
>
>> +}
>
> ...
>
>> +static int vbus_notifier(struct notifier_block *nb,
>> + unsigned long event, void *ptr)
>
> Consider to put it on one line (you can also shrink the names of unused
> parameters.
Sure, will try to reduce the length of the variable names.
Regards
Vadivel
>
>> +{
>> + return NOTIFY_DONE;
>> +}
>
prev parent reply other threads:[~2020-06-17 0:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 2:59 [PATCH v3 0/2] usb : phy: Add USB PHY support on Intel LGM SoC Ramuthevar,Vadivel MuruganX
2020-06-12 2:59 ` [PATCH v3 1/2] dt-bindings: usb: Add USB PHY support for " Ramuthevar,Vadivel MuruganX
2020-06-12 2:59 ` [PATCH v3 2/2] usb: phy: Add USB3 " Ramuthevar,Vadivel MuruganX
2020-06-12 13:18 ` Andy Shevchenko
2020-06-17 0:10 ` Ramuthevar, Vadivel MuruganX [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=530dc44b-59d7-7ecd-4ec9-fd13f5f0e129@linux.intel.com \
--to=vadivel.muruganx.ramuthevar@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=balbi@kernel.org \
--cc=cheol.yong.kim@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=qi-ming.wu@intel.com \
--cc=robh@kernel.org \
--cc=yin1.li@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).