linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Silesh C V <svellattu@mvista.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>
Subject: Re: [PATCH v2 1/2] Driver core: add bus_find_device_by_fwnode
Date: Tue, 9 Oct 2018 08:41:13 +0530	[thread overview]
Message-ID: <CALabi0Gz-er6JKGCYB2UR8UR6uuk-A8H5TbR4DnbEO7gGu9bCw@mail.gmail.com> (raw)
In-Reply-To: <CAJZ5v0gvn=bipyTXEyVUbxJJbOmH5B40K=adaPVxoeX17M+M_Q@mail.gmail.com>

Hello Rafael,

On Mon, Oct 8, 2018 at 1:43 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Tue, Sep 25, 2018 at 7:29 AM Silesh C V <svellattu@mvista.com> wrote:
> >
> > Some drivers need to find the device on a bus having a specific firmware
> > node. Currently, such drivers have their own implementations to do this.
> > Provide a helper similar to bus_find_device_by_name so that each driver
> > does not have to reinvent this.
> >
> > Signed-off-by: Silesh C V <svellattu@mvista.com>
> >
> > ---
> >  drivers/base/bus.c     | 26 ++++++++++++++++++++++++++
> >  include/linux/device.h |  3 +++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/drivers/base/bus.c b/drivers/base/bus.c
> > index 8bfd27e..148b198 100644
> > --- a/drivers/base/bus.c
> > +++ b/drivers/base/bus.c
> > @@ -17,6 +17,7 @@
> >  #include <linux/string.h>
> >  #include <linux/mutex.h>
> >  #include <linux/sysfs.h>
> > +#include <linux/of.h>
> >  #include "base.h"
> >  #include "power/power.h"
> >
> > @@ -373,6 +374,31 @@ struct device *bus_find_device_by_name(struct bus_type *bus,
> >  }
> >  EXPORT_SYMBOL_GPL(bus_find_device_by_name);
> >
> > +static int match_fwnode(struct device *dev, void *data)
> > +{
> > +       struct fwnode_handle *fwnode = data;
> > +       struct device_node *of_node = to_of_node(fwnode);
> > +
> > +       if (of_node)
> > +               return dev->of_node == of_node;
> > +       else
> > +               return dev->fwnode == fwnode;
>
> Why don't you use dev_fwnode() here?
>

OK. Will send an updated patch.

Thanks,
Silesh.

      reply	other threads:[~2018-10-09  3:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  5:28 [PATCH v2 1/2] Driver core: add bus_find_device_by_fwnode Silesh C V
2018-09-25  5:28 ` [PATCH v2 2/2] treewide: use bus_find_device_by_fwnode Silesh C V
2018-09-25  7:04   ` Greg Kroah-Hartman
2018-09-25  7:31     ` Silesh C V
2018-09-25  7:41       ` Silesh C V
2018-10-08  8:08         ` Rafael J. Wysocki
2018-10-08 15:45         ` Rob Herring
2018-10-09  3:13           ` Silesh C V
2018-10-08  8:13 ` [PATCH v2 1/2] Driver core: add bus_find_device_by_fwnode Rafael J. Wysocki
2018-10-09  3:11   ` Silesh C V [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=CALabi0Gz-er6JKGCYB2UR8UR6uuk-A8H5TbR4DnbEO7gGu9bCw@mail.gmail.com \
    --to=svellattu@mvista.com \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.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).