public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt: add a match table pointer to struct device
@ 2011-02-23  2:52 Grant Likely
  2011-02-25 15:46 ` Grant Likely
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2011-02-23  2:52 UTC (permalink / raw)
  To: devicetree-discuss, Greg Kroah-Hartman, linux-kernel

Add a new .of_match field to struct device which points at the
matching device driver .of_match_table entry when a device is probed
via the device tree

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 include/linux/device.h    |    1 +
 include/linux/of_device.h |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/device.h b/include/linux/device.h
index ca5d252..8d8e267 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -441,6 +441,7 @@ struct device {
 	struct dev_archdata	archdata;
 
 	struct device_node	*of_node; /* associated device tree node */
+	const struct of_device_id *of_match; /* matching of_device_id from driver */
 
 	dev_t			devt;	/* dev_t, creates the sysfs "dev" */
 
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 975d347..8bfe6c1 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -18,10 +18,11 @@ extern void of_device_make_bus_id(struct device *dev);
  * @drv: the device_driver structure to test
  * @dev: the device structure to match against
  */
-static inline int of_driver_match_device(const struct device *dev,
+static inline int of_driver_match_device(struct device *dev,
 					 const struct device_driver *drv)
 {
-	return of_match_device(drv->of_match_table, dev) != NULL;
+	dev->of_match = of_match_device(drv->of_match_table, dev);
+	return dev->of_match != NULL;
 }
 
 extern struct platform_device *of_dev_get(struct platform_device *dev);


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt: add a match table pointer to struct device
  2011-02-23  2:52 [PATCH] dt: add a match table pointer to struct device Grant Likely
@ 2011-02-25 15:46 ` Grant Likely
  2011-02-25 16:35   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2011-02-25 15:46 UTC (permalink / raw)
  To: devicetree-discuss, Greg Kroah-Hartman, linux-kernel

Greg, any thoughts on this change?  I'd like to take it via my tree so
I can finally dump the last vestiges of of_platform_bus_type.

Thanks,
g.

On Tue, Feb 22, 2011 at 7:52 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> Add a new .of_match field to struct device which points at the
> matching device driver .of_match_table entry when a device is probed
> via the device tree
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>  include/linux/device.h    |    1 +
>  include/linux/of_device.h |    5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index ca5d252..8d8e267 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -441,6 +441,7 @@ struct device {
>        struct dev_archdata     archdata;
>
>        struct device_node      *of_node; /* associated device tree node */
> +       const struct of_device_id *of_match; /* matching of_device_id from driver */
>
>        dev_t                   devt;   /* dev_t, creates the sysfs "dev" */
>
> diff --git a/include/linux/of_device.h b/include/linux/of_device.h
> index 975d347..8bfe6c1 100644
> --- a/include/linux/of_device.h
> +++ b/include/linux/of_device.h
> @@ -18,10 +18,11 @@ extern void of_device_make_bus_id(struct device *dev);
>  * @drv: the device_driver structure to test
>  * @dev: the device structure to match against
>  */
> -static inline int of_driver_match_device(const struct device *dev,
> +static inline int of_driver_match_device(struct device *dev,
>                                         const struct device_driver *drv)
>  {
> -       return of_match_device(drv->of_match_table, dev) != NULL;
> +       dev->of_match = of_match_device(drv->of_match_table, dev);
> +       return dev->of_match != NULL;
>  }
>
>  extern struct platform_device *of_dev_get(struct platform_device *dev);
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt: add a match table pointer to struct device
  2011-02-25 15:46 ` Grant Likely
@ 2011-02-25 16:35   ` Greg KH
  2011-02-25 17:34     ` Grant Likely
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-02-25 16:35 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss, linux-kernel

On Fri, Feb 25, 2011 at 08:46:52AM -0700, Grant Likely wrote:
> Greg, any thoughts on this change?  I'd like to take it via my tree so
> I can finally dump the last vestiges of of_platform_bus_type.

Sorry, I didn't realize you just wanted my review, and not me to take it
directly.

If you want to take it, that's great, no objection from me, feel free to
add:
	Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
to it.

What about the other patch you sent me, do you want me to take that, or
will you?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt: add a match table pointer to struct device
  2011-02-25 16:35   ` Greg KH
@ 2011-02-25 17:34     ` Grant Likely
  2011-02-25 18:44       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2011-02-25 17:34 UTC (permalink / raw)
  To: Greg KH; +Cc: devicetree-discuss, linux-kernel

On Fri, Feb 25, 2011 at 9:35 AM, Greg KH <gregkh@suse.de> wrote:
> On Fri, Feb 25, 2011 at 08:46:52AM -0700, Grant Likely wrote:
>> Greg, any thoughts on this change?  I'd like to take it via my tree so
>> I can finally dump the last vestiges of of_platform_bus_type.
>
> Sorry, I didn't realize you just wanted my review, and not me to take it
> directly.

Heh, I wasn't very clear about that.  Oops,

> If you want to take it, that's great, no objection from me, feel free to
> add:
>        Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
> to it.

Thanks.  Yes I definitely want to take it because I've got a pile of
patches that depend on it.

> What about the other patch you sent me, do you want me to take that, or
> will you?

Which one is that?  The relaxation of .name checking on of_serial?
Yes, you can take that one, but hold off for the moment.  Looking at
it now I realize that I forgot to cc some folks that should ack it, so
I'm going to repost.

g.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt: add a match table pointer to struct device
  2011-02-25 17:34     ` Grant Likely
@ 2011-02-25 18:44       ` Greg KH
  2011-02-25 19:20         ` Grant Likely
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-02-25 18:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss, linux-kernel

On Fri, Feb 25, 2011 at 10:34:05AM -0700, Grant Likely wrote:
> On Fri, Feb 25, 2011 at 9:35 AM, Greg KH <gregkh@suse.de> wrote:
> > On Fri, Feb 25, 2011 at 08:46:52AM -0700, Grant Likely wrote:
> >> Greg, any thoughts on this change?  I'd like to take it via my tree so
> >> I can finally dump the last vestiges of of_platform_bus_type.
> >
> > Sorry, I didn't realize you just wanted my review, and not me to take it
> > directly.
> 
> Heh, I wasn't very clear about that.  Oops,
> 
> > If you want to take it, that's great, no objection from me, feel free to
> > add:
> >        Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
> > to it.
> 
> Thanks.  Yes I definitely want to take it because I've got a pile of
> patches that depend on it.
> 
> > What about the other patch you sent me, do you want me to take that, or
> > will you?
> 
> Which one is that?  The relaxation of .name checking on of_serial?
> Yes, you can take that one, but hold off for the moment.  Looking at
> it now I realize that I forgot to cc some folks that should ack it, so
> I'm going to repost.

Oops, I just took it :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt: add a match table pointer to struct device
  2011-02-25 18:44       ` Greg KH
@ 2011-02-25 19:20         ` Grant Likely
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2011-02-25 19:20 UTC (permalink / raw)
  To: Greg KH; +Cc: devicetree-discuss, linux-kernel

On Fri, Feb 25, 2011 at 11:44 AM, Greg KH <gregkh@suse.de> wrote:
> On Fri, Feb 25, 2011 at 10:34:05AM -0700, Grant Likely wrote:
>> On Fri, Feb 25, 2011 at 9:35 AM, Greg KH <gregkh@suse.de> wrote:
>> > On Fri, Feb 25, 2011 at 08:46:52AM -0700, Grant Likely wrote:
>> >> Greg, any thoughts on this change?  I'd like to take it via my tree so
>> >> I can finally dump the last vestiges of of_platform_bus_type.
>> >
>> > Sorry, I didn't realize you just wanted my review, and not me to take it
>> > directly.
>>
>> Heh, I wasn't very clear about that.  Oops,
>>
>> > If you want to take it, that's great, no objection from me, feel free to
>> > add:
>> >        Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
>> > to it.
>>
>> Thanks.  Yes I definitely want to take it because I've got a pile of
>> patches that depend on it.
>>
>> > What about the other patch you sent me, do you want me to take that, or
>> > will you?
>>
>> Which one is that?  The relaxation of .name checking on of_serial?
>> Yes, you can take that one, but hold off for the moment.  Looking at
>> it now I realize that I forgot to cc some folks that should ack it, so
>> I'm going to repost.
>
> Oops, I just took it :(


Hahaha!  No worries, just hold onto it.  I'll ping the appropriate
folks and if anyone objects then I'll ask you to drop it.

g.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-25 19:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23  2:52 [PATCH] dt: add a match table pointer to struct device Grant Likely
2011-02-25 15:46 ` Grant Likely
2011-02-25 16:35   ` Greg KH
2011-02-25 17:34     ` Grant Likely
2011-02-25 18:44       ` Greg KH
2011-02-25 19:20         ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox