From patchwork Tue Aug 23 02:06:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 661681 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sJDRf1Tx0z9sD6 for ; Tue, 23 Aug 2016 12:10:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=AXNKbl8R; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sJDRd5yb6zDrd3 for ; Tue, 23 Aug 2016 12:10:21 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=AXNKbl8R; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yw0-x241.google.com (mail-yw0-x241.google.com [IPv6:2607:f8b0:4002:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sJDN53tzRzDrK6 for ; Tue, 23 Aug 2016 12:07:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=AXNKbl8R; dkim-atps=neutral Received: by mail-yw0-x241.google.com with SMTP id r9so4420822ywg.2 for ; Mon, 22 Aug 2016 19:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iLJUYl/kcKCrUdwr9F050jk7rktr4FnTZrmusgjEvw4=; b=AXNKbl8Rp40G5P4tuvzLYQivimxUfk2TjBusWsXbafbZ2foQkqQYgp0YOtywjYX1ib SKYRoA464D8aBxgkihtBNBNA/IBIGSqrnG8Rov/MCX1PKEuWVoNxb0Z8Fa5n4szl1pBe McKmKCyNk5h60txvzY2C2rOSuCGccx7goIRz53GDBIRm/agWbMJRTjrWuOOBPaY9q3/i NtqXTtk5mRy54q34AOn8BGeFTAN1UeTF8kuEFbTdqE967RhdrTTfFqmQnYjZY9l8ytT/ 6mXP8DnPIQmX8TFTGm75jkIFkshGOETDkQW7bvhSXc5F+7a3QMp1F+BXseIYIUG/JXbz BZ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iLJUYl/kcKCrUdwr9F050jk7rktr4FnTZrmusgjEvw4=; b=DRXhxUCAVYMWdm7WEM8Lw/gfCR0LKOo2vMrSTD+uC0sfR1h4EgdWicJdqWscW9f8N7 uS47Md76Cx4Cmlsl4ZxPRkdHYgTgySNpDLuv+LUtubuc3dDVQ4tEip4FI1EX1AuMlMHn /RH0miaDiD9PMURhMtwcu8MSbPURvwGL7vtirjepb9v8VPXSefbUG4H753YfRxP/+rk3 Dh2suHKrQzbKYh67FoZpRfFCYO5ryALmQrmaexUSBHxTT0RdBdo8JTxZy4NijpZKxLvb PM0/ecveL5+kdBorW69ab0rFNeGi4JTpiwgZ6i+RvTolQ7Y+iCsZjB5zbEBuJPcg9J9F 2ScA== X-Gm-Message-State: AEkoouuOTSZeg96mKRyeBXUYEEe1xCe2SaQfmWh4e2JkfeBkLS/DlY25sZ7s9UxQyH0L9w== X-Received: by 10.13.242.129 with SMTP id b123mr19722614ywf.36.1471918035723; Mon, 22 Aug 2016 19:07:15 -0700 (PDT) Received: from pek-khao-d1.wrs.com (unknown-178-22.windriver.com. [147.11.178.22]) by smtp.gmail.com with ESMTPSA id u187sm533582ywu.27.2016.08.22.19.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2016 19:07:15 -0700 (PDT) From: Kevin Hao To: linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org Subject: [PATCH 1/5] of/platform: introduce arch_want_default_of_probe() Date: Tue, 23 Aug 2016 10:06:55 +0800 Message-Id: <1471918019-19472-2-git-send-email-haokexin@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1471918019-19472-1-git-send-email-haokexin@gmail.com> References: <1471918019-19472-1-git-send-email-haokexin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" In commit fc520f8b4fa3 ("of/platform: disable the of_platform_default_populate_init() for all the ppc boards"), we disable the default of probe for ppc in order to fix some broken boards. But we do want to leverage the default of probe function on ppc arch. So introduce a weak function arch_want_default_of_probe(), we can override it in arch specific code to enable/disable the default of probe per board. Signed-off-by: Kevin Hao --- arch/powerpc/kernel/of_platform.c | 5 +++++ drivers/of/platform.c | 9 ++++++--- include/linux/of_platform.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index b60a67d92ebd..ace7fe132b6f 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c @@ -122,3 +122,8 @@ static __init int of_pci_phb_init(void) device_initcall(of_pci_phb_init); #endif /* CONFIG_PPC_OF_PLATFORM_PCI */ + +bool __init arch_want_default_of_probe(void) +{ + return false; +} diff --git a/drivers/of/platform.c b/drivers/of/platform.c index f39ccd5aa701..6aaa1438c9cd 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -497,12 +497,16 @@ int of_platform_default_populate(struct device_node *root, } EXPORT_SYMBOL_GPL(of_platform_default_populate); -#ifndef CONFIG_PPC +bool __init __weak arch_want_default_of_probe(void) +{ + return true; +} + static int __init of_platform_default_populate_init(void) { struct device_node *node; - if (!of_have_populated_dt()) + if (!arch_want_default_of_probe() || !of_have_populated_dt()) return -ENODEV; /* @@ -522,7 +526,6 @@ static int __init of_platform_default_populate_init(void) return 0; } arch_initcall_sync(of_platform_default_populate_init); -#endif static int of_platform_device_destroy(struct device *dev, void *data) { diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 956a1006aefc..02cf1fdaa3d0 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -76,6 +76,7 @@ extern int of_platform_default_populate(struct device_node *root, const struct of_dev_auxdata *lookup, struct device *parent); extern void of_platform_depopulate(struct device *parent); +extern bool arch_want_default_of_probe(void); #else static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches,