linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] ohci-platform: Add support for devicetree instantiation
Date: Thu, 09 Jan 2014 19:18:45 +0100	[thread overview]
Message-ID: <52CEE805.8010703@redhat.com> (raw)
In-Reply-To: <4432391.5QkdBVBQQi@wuerfel>

Hi,

On 01/09/2014 07:07 PM, Arnd Bergmann wrote:
> On Thursday 09 January 2014 18:57:05 Hans de Goede wrote:
>> +       if (pdata == &ohci_platform_defaults && dev->dev.of_node) {
>> +               priv->phy = devm_phy_get(&dev->dev, "usb");
>> +               if (IS_ERR(priv->phy)) {
>> +                       err = PTR_ERR(priv->phy);
>> +                       if (err == -EPROBE_DEFER)
>> +                               goto err_put_hcd;
>> +                       priv->phy = NULL;
>> +               }
>> +
>> +               for (clk = 0; clk < OHCI_MAX_CLKS; clk++) {
>> +                       priv->clks[clk] = of_clk_get(dev->dev.of_node, clk);
>> +                       if (IS_ERR(priv->clks[clk])) {
>> +                               err = PTR_ERR(priv->clks[clk]);
>> +                               if (err == -EPROBE_DEFER)
>> +                                       goto err_put_clks;
>> +                               priv->clks[clk] = NULL;
>> +                               break;
>> +                       }
>> +               }
>> +       }
>
> Ah, very nice! This way it will actually work to replace a number
> of older drivers that require a specific clock name.

I'm glad you like it.
>
> I still think we should change the phy subsystem to allow the
> same, that would make it more consistent here, and avoid the
> need for coming up with a number of bogus phy names for random
> drivers that can only ever have one phy.

I'm not disagreeing, but that will have to be a battle for
another day. Currently the dt-bindings for phy actually
make phy-names mandatory at the bindings-description level, so
someone would first need to change the specification.

Documentation/devicetree/bindings/phy/phy-bindings.txt:

"""
PHY user node
=============

Required Properties:
phys : the phandle for the PHY device (used by the PHY subsystem)
phy-names : the names of the PHY corresponding to the PHYs present in the
             *phys* phandle
"""

Regards,

Hans

  reply	other threads:[~2014-01-09 18:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 17:57 [PATCH v3 0/2] ohci and ehci-platform clks, phy and dt support Hans de Goede
2014-01-09 17:57 ` [PATCH v3 1/2] ohci-platform: Add support for devicetree instantiation Hans de Goede
2014-01-09 18:07   ` Arnd Bergmann
2014-01-09 18:18     ` Hans de Goede [this message]
2014-01-09 20:14   ` Sergei Shtylyov
2014-01-09 19:48     ` Hans de Goede
2014-01-09 21:08       ` Sergei Shtylyov
2014-01-10  9:47         ` [linux-sunxi] " Hans de Goede
2014-01-10 22:02           ` Sergei Shtylyov
2014-01-09 20:36   ` Alan Stern
2014-01-10 10:13     ` Hans de Goede
2014-01-10 15:29       ` Alan Stern
2014-01-09 17:57 ` [PATCH v3 2/2] ehci-platform: Add support for clks and phy passed through devicetree Hans de Goede

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=52CEE805.8010703@redhat.com \
    --to=hdegoede@redhat.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).