From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Ramuthevar,Vadivel MuruganX"
<vadivel.muruganx.ramuthevar@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, balbi@kernel.org,
p.zabel@pengutronix.de, gregkh@linuxfoundation.org,
robh@kernel.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 v2 2/2] usb: phy: Add USB3 PHY support for Intel LGM SoC
Date: Thu, 11 Jun 2020 11:12:54 +0300 [thread overview]
Message-ID: <20200611081254.GR2428291@smile.fi.intel.com> (raw)
In-Reply-To: <20200611021246.3250-3-vadivel.muruganx.ramuthevar@linux.intel.com>
On Thu, Jun 11, 2020 at 10:12:46AM +0800, Ramuthevar,Vadivel MuruganX wrote:
> From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar@linux.intel.com>
>
> Add support for USB PHY on Intel LGM SoC.
...
> +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");
> + return false;
return ret;
> + }
> +
> + *flipped = property.intval;
> +
> + return *flipped;
return 0;
> +}
...I suppose it should be as above.
...
> + ret = readl_poll_timeout(ctrl1, val, val & SRAM_INIT_DONE,
> + 10, 10 * 1000);
On one line easier to read.
> + if (ret) {
> + dev_err(ta->phy.dev, "SRAM init failed, 0x%x\n", val);
> + return ret;
> + }
...
> +static int phy_set_vbus(struct usb_phy *phy, int on)
> +{
> + struct tca_apb *ta = container_of(phy, struct tca_apb, phy);
> + int ret = 0;
Assignment is redundant.
> +
> + if (on) {
> + ret = regulator_enable(ta->vbus);
> + if (ret)
> + dev_err(ta->phy.dev, "regulator not enabled\n");
> + } else {
> + ret = regulator_disable(ta->vbus);
> + if (ret)
> + dev_err(ta->phy.dev, "regulator not disabled\n");
> + }
> +
> + return ret;
> +}
...
> + ret = get_flipped(ta, &flipped);
> + if (!ret)
> + dev_err(ta->phy.dev, "no polarity property from extcon\n");
This should be fixed accordingly.
...
> + dev_info(ta->phy.dev, "connected%s\n",
> + flipped ? " flipped" : "");
One line.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2020-06-11 8:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-11 2:12 [PATCH v2 0/2] usb : phy: Add USB PHY support on Intel LGM SoC Ramuthevar,Vadivel MuruganX
2020-06-11 2:12 ` [PATCH v2 1/2] dt-bindings: usb: Add USB PHY support for " Ramuthevar,Vadivel MuruganX
2020-06-11 2:12 ` [PATCH v2 2/2] usb: phy: Add USB3 " Ramuthevar,Vadivel MuruganX
2020-06-11 8:12 ` Andy Shevchenko [this message]
2020-06-11 8:36 ` Ramuthevar, Vadivel MuruganX
2020-06-11 8:57 ` Andy Shevchenko
2020-06-11 9:01 ` Ramuthevar, Vadivel MuruganX
2020-07-25 6:22 ` Felipe Balbi
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=20200611081254.GR2428291@smile.fi.intel.com \
--to=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=vadivel.muruganx.ramuthevar@linux.intel.com \
--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).