lkml.org 
[lkml]   [2012]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] of: When constructing the bus id consider assigned-addresses as well
Date
On Wed, 21 Nov 2012 14:02:40 -0700, Jason Gunthorpe <jgunthorpe@obsidianresearch.com> wrote:
> 'assigned-addresses' is used for certain PCI device type nodes in
> lieu of 'reg', since this is enforced by of/address.c, have
> of_device_make_bus_id look there as well.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

If it is a PCI device, then of_device_make_bus_id() shouldn't come into
play. PCI devices already have their own naming scheme. Only
platform_bus device creation uses of_device_make_bus_id(). What am I
missing?

g.

> ---
> drivers/of/platform.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> of_can_translate_address and of_translate_address already support
> using assigned-addresses.
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index b80891b..4f0f701 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -105,6 +105,8 @@ void of_device_make_bus_id(struct device *dev)
> * For MMIO, get the physical address
> */
> reg = of_get_property(node, "reg", NULL);
> + if (!reg)
> + reg = of_get_property(node, "assigned-addresses", NULL);
> if (reg) {
> if (of_can_translate_address(node)) {
> addr = of_translate_address(node, reg);
> --
> 1.7.5.4
>

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


\
 
 \ /
  Last update: 2012-11-26 18:01    [W:1.291 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site