linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: gautam.vivek@samsung.com (Vivek Gautam)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb: ohci-exynos: Add facility to use phy provided by the generic phy framework
Date: Wed, 23 Apr 2014 13:07:28 +0530	[thread overview]
Message-ID: <CAFp+6iGfsv7tLvaqCp6=BNSX3dtwuSLRGfOMDoFD4zSQHd9m3g@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1404221350300.1326-100000@iolanthe.rowland.org>

Hi Alan,


On Tue, Apr 22, 2014 at 11:28 PM, Alan Stern <stern@rowland.harvard.edu> wrote:

Thanks for reviewing this. Please find my comments inline below.

> On Thu, 10 Apr 2014, Vivek Gautam wrote:
>
>> Add support to consume phy provided by Generic phy framework.
>> Keeping the support for older usb-phy intact right now, in order
>> to prevent any functionality break in absence of relevant
>> device tree side change for ohci-exynos.
>> Once we move to new phy in the device nodes for ohci, we can
>> remove the support for older phys.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>> Cc: Jingoo Han <jg1.han@samsung.com>
>> Cc: Alan Stern <stern@rowland.harvard.edu>
>
>> +static int exynos_ohci_phyg_on(struct phy *phy, bool on)
>> +{
>> +     int ret = 0;
>> +
>> +     if (phy) {
>> +             if (on)
>> +                     ret = phy_power_on(phy);
>> +             else
>> +                     ret = phy_power_off(phy);
>> +     }
>> +
>> +     return ret;
>> +}
>
> This would be cleaner if you had separate routines for
> exynos_ohci_phyg_of and exynos_ohci_phyg_off.  For example:
>
> static int exynos_ohci_phyg_on(struct phy *phy)
> {
>         return phy ? phy_power_on(phy) : 0;
> }

Sure, i will make two separate routines here.

>
>> @@ -88,16 +104,49 @@ static int exynos_ohci_probe(struct platform_device *pdev)
>>                                       "samsung,exynos5440-ohci"))
>>               goto skip_phy;
>>
>> -     phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
>> -     if (IS_ERR(phy)) {
>> -             usb_put_hcd(hcd);
>> -             dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
>> -             return -EPROBE_DEFER;
>> +     exynos_ohci->phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
>> +     if (IS_ERR(exynos_ohci->phy)) {
>> +             err = PTR_ERR(exynos_ohci->phy);
>> +             if (err == -ENXIO || err == -ENODEV) {
>> +                     exynos_ohci->phy = NULL;
>> +             } else if (err == -EPROBE_DEFER) {
>> +                     usb_put_hcd(hcd);
>> +                     return err;
>> +             } else {
>> +                     dev_err(&pdev->dev, "no usb2 phy configured\n");
>> +                     usb_put_hcd(hcd);
>> +                     return err;
>> +             }
>
> Instead of all the calls to usb_put_hcd() here and below, just goto
> fail_clk.  Or add a new fail_phy label at the same spot and goto it.

Sure, i can use a new label here.

>
> Otherwise this looks basically okay.

Sure, i will send the next version of this patch after rework.

      reply	other threads:[~2014-04-23  7:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 13:24 [PATCH] usb: ohci-exynos: Add facility to use phy provided by the generic phy framework Vivek Gautam
2014-04-21 19:30 ` Vivek Gautam
2014-04-22 17:59   ` Alan Stern
2014-04-23  7:40     ` Vivek Gautam
2014-04-22 17:58 ` Alan Stern
2014-04-23  7:37   ` Vivek Gautam [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='CAFp+6iGfsv7tLvaqCp6=BNSX3dtwuSLRGfOMDoFD4zSQHd9m3g@mail.gmail.com' \
    --to=gautam.vivek@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).