linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	linux-kernel@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] of: Have of_device_add call platform_device_add rather than device_add
Date: Wed, 21 Nov 2012 15:51:04 +0000	[thread overview]
Message-ID: <20121121155104.726B83E0AE2@localhost> (raw)
In-Reply-To: <20121121072448.GG19837@obsidianresearch.com>

On Wed, 21 Nov 2012 00:24:48 -0700, Jason Gunthorpe <jgunthorpe@obsidianresearch.com> wrote:
> This allows platform_device_add a chance to call insert_resource
> on all of the resources from OF. At a minimum this fills in proc/iomem
> and presumably makes resource tracking and conflict detection work
> better.
> 
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
>  drivers/of/device.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> Tested on PPC32 and ARM32 embedded kernels.
> 
> diff --git a/drivers/of/device.c b/drivers/of/device.c
> index 4c74e4f..a5b67dc 100644
> --- a/drivers/of/device.c
> +++ b/drivers/of/device.c
> @@ -62,7 +62,7 @@ int of_device_add(struct platform_device *ofdev)
>  	if (!ofdev->dev.parent)
>  		set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->dev.of_node));
>  
> -	return device_add(&ofdev->dev);
> +	return platform_device_add(ofdev);
>  }
>  
>  int of_device_register(struct platform_device *pdev)

This has the side effect of moving all devices at the root of the tree
from /sys/devices/ to /sys/devices/platform. It also has the possibility
of breaking if any devices get registered with overlapping regions. I
think there are some powerpc 5200 boards that do this, and I'm not sure
about the larger Power boxen.

I've got a more nuanced version of this patch that I'm trying to get
published today for review. I'll add you to the cc list.

g.

> -- 
> 1.7.4.1
> 

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

  reply	other threads:[~2012-11-21 15:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  7:24 [PATCH] of: Have of_device_add call platform_device_add rather than device_add Jason Gunthorpe
2012-11-21 15:51 ` Grant Likely [this message]
2012-11-21 16:05   ` Grant Likely
2012-11-21 17:44   ` Jason Gunthorpe
2012-11-21 18:07     ` Grant Likely
2012-11-21 18:14       ` Jason Gunthorpe
2012-11-22 15:36         ` Grant Likely
2012-11-22 17:30           ` Jason Gunthorpe
2012-11-26 14:30             ` Grant Likely
2012-11-26 15:28             ` Grant Likely

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=20121121155104.726B83E0AE2@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    /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).