From patchwork Thu May 19 18:28:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 799242 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4JIV6hb025343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 May 2011 18:31:27 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QN7y8-0008DA-R5; Thu, 19 May 2011 18:29:09 +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 1QN7y3-0007rc-QM; Thu, 19 May 2011 18:29:03 +0000 Received: from mail-yx0-f177.google.com ([209.85.213.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QN7y0-0007r2-JJ for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2011 18:29:01 +0000 Received: by yxh35 with SMTP id 35so1211400yxh.36 for ; Thu, 19 May 2011 11:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=8mU8asZ0MfxritFNxKUWP6n69TRWO604yr6ZRTZBgxc=; b=s3LcYCR8PSTdtHv4lYpTUskYe6stSiU1O1x73XvBx4XxekJuZoqdt4oCGviO3kXjOy kys1kwIlMWxlDsEyHjaUXXpQAto+ogAJK0OPKb1wlG1kLu3XQHUf7zEzE0nLvEFMtek1 Owaom7x/5yZAzyCIFcEOBgfLkKDOpsLzX79L4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=DBEcRVKu4+LEuZGNQOCLAtJDL7Usg7nrMiNACyTn3PfrO44MkPeG5CIkwpdGnaXK0j Ppla+vvboFFrjSGFLhJh92cWFIQN/R7PcDYTkrP3hxhMLgP2GpYSDXMVs+ztzo9WcN6/ 2Im+SpycVzNRJdB0YaWkRq7OpH/ylEt9QBpGU= Received: by 10.147.165.11 with SMTP id s11mr2667152yao.3.1305829739865; Thu, 19 May 2011 11:28:59 -0700 (PDT) Received: from rob-laptop.i.smooth-stone.com ([173.226.190.126]) by mx.google.com with ESMTPS id s36sm2007672ano.27.2011.05.19.11.28.59 (version=SSLv3 cipher=OTHER); Thu, 19 May 2011 11:28:59 -0700 (PDT) From: Rob Herring To: devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca Subject: [PATCH 1/2] dt: check for devices already created fron DT scan Date: Thu, 19 May 2011 13:28:23 -0500 Message-Id: <1305829704-11774-2-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305829704-11774-1-git-send-email-robherring2@gmail.com> References: <1305829704-11774-1-git-send-email-robherring2@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110519_142900_753319_0C005EF9 X-CRM114-Status: GOOD ( 12.14 ) 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.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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.177 listed in list.dnswl.org] -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 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: Rob Herring 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: , MIME-Version: 1.0 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]); Thu, 19 May 2011 18:31:27 +0000 (UTC) From: Rob Herring of_platform_bus_create may create duplicate devices if already added when scanning other buses like amba bus. Signed-off-by: Rob Herring --- drivers/of/platform.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 9b785be..7bf74fb 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -234,6 +234,13 @@ static int of_platform_bus_create(struct device_node *bus, return 0; } + /* Has the device already been registered? */ + if (of_find_device_by_node(bus)) { + pr_debug("%s() - skipping %s, already registered\n", + __func__, bus->full_name); + return 0; + } + dev = of_platform_device_create(bus, NULL, parent); if (!dev || !of_match_node(matches, bus)) return 0; @@ -326,4 +333,5 @@ int of_platform_populate(struct device_node *root, of_node_put(root); return rc; } +EXPORT_SYMBOL(of_platform_populate); #endif /* !CONFIG_SPARC */