mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@linaro.org>
To: Rob Herring <robherring2@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [RFC] driver-core: Remove dummy 'platform_bus'
Date: Wed, 23 Apr 2014 15:05:08 +0100	[thread overview]
Message-ID: <20140423140508.2575AC408D2@trevor.secretlab.ca> (raw)
In-Reply-To: <CAL_JsqJFM1e2Y7GykK06KuZ8fD8iZ=64W1i+tqibJ9datCUR0Q@mail.gmail.com>

On Mon, 21 Apr 2014 16:05:29 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Wed, Nov 21, 2012 at 8:44 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > The "platform_bus" (note: not platform_bus_type) only exists as an empty
> > directory to put platform devices into. However, it really doesn't make
> > sense to segregate all the platform devices into a sub directory when
> > typically they are memory mapped devices that doen't go through any
> > particular bus. Particularly on embedded type platforms the platform_bus
> > directory doesn't add anything.
> >
> > However, this will probably just end up breaking some userspace that
> > depends on the /sys/devices/platform/ path to be present (no matter how
> > much we protest that userspace must not depend on paths in sysfs). So
> > while I'm seriously proposing this change, it may just be unacceptable
> > ABI breakage
> 
> An old thread, but was there ever a conclusion to this? We now have a
> mixture of using platform_bus as the parent or not on various ARM
> platforms.

We kind of concluded in the opposite direction. Instead of removing the
/sys/device/platform directory, the drivers/of code should be changed to
use it.

The following patch is sufficient to have the same effect. It doesn't
unify the OF and non-OF paths of platform device addition, but it gets
them closer. I've been nervous about applying it because I'm concerned
about userspace breakage, but maybe it just needs to be merged and we
can quirk out systems that break.

---

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 404d1daebefa..40a85b85c932 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -175,7 +175,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
 #if defined(CONFIG_MICROBLAZE)
 	dev->dev.dma_mask = &dev->archdata.dma_mask;
 #endif
-	dev->dev.parent = parent;
+	dev->dev.parent = parent ? parent : &platform_bus;
 
 	if (bus_id)
 		dev_set_name(&dev->dev, "%s", bus_id);


  reply	other threads:[~2014-04-23 14:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 14:44 Grant Likely
2012-11-21 14:52 ` Greg Kroah-Hartman
2012-11-22 19:17   ` Kay Sievers
2012-11-22 21:20     ` Grant Likely
2012-11-23 14:39       ` Kay Sievers
2014-04-21 21:05 ` Rob Herring
2014-04-23 14:05   ` Grant Likely [this message]
2014-04-23 14:16     ` Rob Herring
2014-04-23 14:49       ` Grant Likely
2014-04-23 14:44     ` 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=20140423140508.2575AC408D2@trevor.secretlab.ca \
    --to=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robherring2@gmail.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

all inboxes | Powered by JetHome®