linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: clabbe.montjoie@gmail.com (LABBE Corentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-sunxi] Re: [PATCH v3 1/2] phy-sun4i-usb: Use of_match_node to get model specific config data
Date: Thu, 26 Nov 2015 08:14:43 +0100	[thread overview]
Message-ID: <20151126071443.GA28184@Red> (raw)
In-Reply-To: <CAGb2v64XL=bptxoCwiVkf8u-EfckpuASS3Foo=Q3i4a_6CaJYA@mail.gmail.com>

On Thu, Nov 26, 2015 at 12:22:59PM +0800, Chen-Yu Tsai wrote:
> On Thu, Nov 26, 2015 at 12:50 AM, Hans de Goede <hdegoede@redhat.com> wrote:
> > +
> >  static const unsigned int sun4i_usb_phy0_cable[] = {
> >         EXTCON_USB,
> >         EXTCON_USB_HOST,
> > @@ -511,10 +578,16 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
> >         struct device *dev = &pdev->dev;
> >         struct device_node *np = dev->of_node;
> >         struct phy_provider *phy_provider;
> > -       bool dedicated_clocks;
> > +       const struct of_device_id *match;
> >         struct resource *res;
> >         int i, ret;
> >
> > +       match = of_match_node(sun4i_usb_phy_of_match, dev->of_node);
> 
> You can use of_device_get_match_data() for slightly less code. This
> will also let you keep the of_device_id table where it was, at the
> bottom.
> 
> > +       if (!match) {
> 
> I'm working on something similar in the axp20x driver. Is there any
> case of_match_node or of_device_get_match_data can fail?
> 
> 

Hello

I am working on some patch for that case and the conclusion was that case is possible.
See https://lkml.org/lkml/2015/11/12/97
So it is better to check it.

Regards

  reply	other threads:[~2015-11-26  7:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 16:50 [PATCH v3 1/2] phy-sun4i-usb: Use of_match_node to get model specific config data Hans de Goede
2015-11-25 16:50 ` [PATCH v3 2/2] phy-sun4i-usb: Add support for the host usb-phys found on the H3 SoC Hans de Goede
2015-11-25 22:11   ` Rob Herring
2015-11-26 12:03     ` [linux-sunxi] " Hans de Goede
2015-12-01 15:56   ` [linux-sunxi] " Priit Laes
2015-11-26  4:22 ` [PATCH v3 1/2] phy-sun4i-usb: Use of_match_node to get model specific config data Chen-Yu Tsai
2015-11-26  7:14   ` LABBE Corentin [this message]
2015-11-26 12:11   ` [linux-sunxi] " Hans de Goede
2015-11-27  8:53     ` Maxime Ripard
2015-11-27 10:37       ` Hans de Goede
2015-11-27 10:41         ` 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=20151126071443.GA28184@Red \
    --to=clabbe.montjoie@gmail.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).