lkml.org 
[lkml]   [2011]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] dt: add a match table pointer to struct device
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-02-25 16:49    [W:0.043 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site