From patchwork Tue Apr 19 21:10:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 8883441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 39B3A9F39A for ; Tue, 19 Apr 2016 21:13:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6215C2013A for ; Tue, 19 Apr 2016 21:13:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DCE2202A1 for ; Tue, 19 Apr 2016 21:13:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ascvr-0002GY-S8; Tue, 19 Apr 2016 21:11:39 +0000 Received: from mail.kernel.org ([198.145.29.136]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ascvo-000296-IF for linux-arm-kernel@lists.infradead.org; Tue, 19 Apr 2016 21:11:36 +0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67C6A2035B for ; Tue, 19 Apr 2016 21:11:15 +0000 (UTC) Received: from mail-yw0-f171.google.com (mail-yw0-f171.google.com [209.85.161.171]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F36B2202F8 for ; Tue, 19 Apr 2016 21:11:11 +0000 (UTC) Received: by mail-yw0-f171.google.com with SMTP id j74so28792327ywg.1 for ; Tue, 19 Apr 2016 14:11:11 -0700 (PDT) X-Gm-Message-State: AOPr4FWT7oNyQH7sMwNSxWU30AE3nleq3y05XUGO8IXRY7zCOtDrC8y8zRLhgvFH4aAoYwLce1LWtAhoqKTIPQ== X-Received: by 10.129.41.16 with SMTP id p16mr3649775ywp.92.1461100271286; Tue, 19 Apr 2016 14:11:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.145.141 with HTTP; Tue, 19 Apr 2016 14:10:51 -0700 (PDT) In-Reply-To: <1458113743-15131-1-git-send-email-wangkefeng.wang@huawei.com> References: <1458113743-15131-1-git-send-email-wangkefeng.wang@huawei.com> From: Rob Herring Date: Tue, 19 Apr 2016 16:10:51 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 all 00/14] use of_platform_default_populate() to populate default bus To: Kefeng Wang X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160419_141136_638077_F9C7F891 X-CRM114-Status: GOOD ( 21.58 ) X-Spam-Score: -5.2 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King - ARM Linux , Arnd Bergmann , Masahiro Yamada , Catalin Marinas , "linux-kernel@vger.kernel.org" , Olof Johansson , Hanjun Guo , Grant Likely , Shawn Guo , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Mar 16, 2016 at 2:35 AM, Kefeng Wang wrote: > Use helper of_platform_default_populate() in linux/of_platform > when possible, instead of calling of_platform_populate() with > the default match table. > > Then it is possible for driver code build as a module, and no > need to export of_default_bus_match_table anymore. > > This patchset is based on Linux 4.5. > > Changes since v1: > - Add ack, test and review > - Remove v1 patch 14/15, the similar patch has posted and applied, > see https://patchwork.kernel.org/patch/8096991/ > > v1: > - https://lkml.org/lkml/2016/1/26/1123 I was going to apply this, but I've thought about this some more and it is a lot of tree wide churn for little gain. Most of the call sites here I want to get rid of by making of_platform_populate callable multiple times. The infrastructure is almost there, but I think we just need something like this: Then we can call of_platform_populate from the DT core and remove all the default calls. Rob diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 8d103e4..b25e710 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -345,6 +345,9 @@ static int of_platform_bus_create(struct device_node *bus, return 0; } + if (of_node_check_flag(bus, OF_POPULATED_BUS)) + return 0; + auxdata = of_dev_lookup(lookup, bus); if (auxdata) { bus_id = auxdata->name;