From patchwork Wed Jun 8 03:12:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 860642 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p583D4dJ020741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 8 Jun 2011 03:13:25 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QU9CT-0000tH-6o; Wed, 08 Jun 2011 03:12:57 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QU9CS-0004NX-P3; Wed, 08 Jun 2011 03:12:56 +0000 Received: from mail-iy0-f177.google.com ([209.85.210.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QU9CP-0004NE-Kp for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2011 03:12:54 +0000 Received: by iyb39 with SMTP id 39so106395iyb.36 for ; Tue, 07 Jun 2011 20:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=R26oAbHSivv9vFgxC1iVHfCZdtjlkYpr0CK0SQz50Cg=; b=nojc7Ybzo6y0U+6LZ2Tt5Mnwo6PiQ58ETvZpEuWfxPCLXhtpOevOFd/xB8UQZYzf4G QSxAKOX203BvX7yMWmNXaDKXNGMB+2NJ/J5GRsEYuy0oeQ6pIUexDdpFmddE96wZSc1u Mx5CYlkorOg2R6ysaFBYFSdN679eHwZN3Oqnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=SFIow/fJHF6t/23MkEPNvkH0gxPHpQLcv5s6Kauf32rHK6aRAFKQ6MsL0SJDdZG2kH jg4X04mtL6/GyPqDZwLK9wXOBBR8a2ljsTJ4fHxm55h6ch3P+AvrZguXhmKk8wAxFb5j ZM/K7snQttUsrMCv+nIopJf43Memo3DNc4kcw= Received: by 10.42.138.2 with SMTP id a2mr11717567icu.328.1307502771443; Tue, 07 Jun 2011 20:12:51 -0700 (PDT) Received: from [192.168.1.101] (65-36-74-215.dyn.grandenetworks.net [65.36.74.215]) by mx.google.com with ESMTPS id 4sm68560ibc.42.2011.06.07.20.12.48 (version=SSLv3 cipher=OTHER); Tue, 07 Jun 2011 20:12:49 -0700 (PDT) Message-ID: <4DEEE8AF.50603@gmail.com> Date: Tue, 07 Jun 2011 22:12:47 -0500 From: Rob Herring User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Arnd Bergmann Subject: Re: [RFC PATCH v3 2/2] dt: add custom device creation to platform bus scan References: <1306359073-16274-1-git-send-email-robherring2@gmail.com> <4DE66E39.2070300@gmail.com> <201106012329.20651.arnd@arndb.de> In-Reply-To: <201106012329.20651.arnd@arndb.de> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110607_231253_963645_DD3B7570 X-CRM114-Status: GOOD ( 19.56 ) X-Spam-Score: 1.4 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (robherring2[at]gmail.com) 2.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain Cc: linux@arm.linux.org.uk, devicetree-discuss@lists.ozlabs.org, Grant Likely , Jeremy Kerr , Linus Walleij , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 08 Jun 2011 03:13:25 +0000 (UTC) On 06/01/2011 04:29 PM, Arnd Bergmann wrote: > On Wednesday 01 June 2011, Grant Likely wrote: >>> >>> Shouldn't the hierarchy in linux reflect the h/w? It seems a bit pointless >>> to me to create a device just to create another device. amba_bus is already >>> a bit strange in that it is not really a bus type, but a certain class of >>> peripherals. >>> >>> I'd like to hear Grant's thoughts on this. >> >> AMBA and platform_devices are "special" in that they don't have >> requirements on their parent device. I see absolutely zero issue with >> having platform_device and amba_device as siblings. > > Hmm, if we accept that platform and AMBA devices are just different from > all the others, maybe we can do a simpler solution and just hardcode that > difference in the of_platform_bus_create function. It probably doesn't > hurt if we grow a handful of these at most, as long as we wouldn't add > code for a lot of different bus types to the common probing function. > > Arnd The simplest solutions are usually the best. With that, the 2nd patch becomes: return 0; diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 9b785be..6955932 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -21,6 +21,7 @@ #include #include #include +#include static int of_dev_node_match(struct device *dev, void *data) { @@ -234,6 +235,11 @@ static int of_platform_bus_create(struct device_node *bus, return 0; } + if (of_device_is_compatible(bus, "arm,amba-device")) { + of_amba_device_create(bus, parent); + return 0; + } + dev = of_platform_device_create(bus, NULL, parent); if (!dev || !of_match_node(matches, bus))