From patchwork Tue Apr 17 06:27:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 899078 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Er3JBMpD"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40QFgd1GKlz9s1X for ; Tue, 17 Apr 2018 16:28:29 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbeDQG21 (ORCPT ); Tue, 17 Apr 2018 02:28:27 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36749 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbeDQG2V (ORCPT ); Tue, 17 Apr 2018 02:28:21 -0400 Received: by mail-pf0-f193.google.com with SMTP id g14so11698325pfh.3 for ; Mon, 16 Apr 2018 23:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KM+EqYgICCOsruVezJzkot2wv6BLWbmdhsYoWQjiM4o=; b=Er3JBMpD3nyGac0fzsz1sYVLZa/Ae9Juk7MXk2N/F1a/uFNXu8pdQQR8pNCGAm3MQD isIote1qMlHntEfp530iT2mJ6haNYYCKC+83xd3jRSw2/qVCESZna6MSkjGANGzGqSzh 1awYOQrYQ0nwaSAShogAEpI7Z1MRfpMG3S9oQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KM+EqYgICCOsruVezJzkot2wv6BLWbmdhsYoWQjiM4o=; b=cUgCPHPwnPbkvZ0FkaoPZ4+71Ovv5C1owLFxesjn1ADGTZNPxzaDd3Hunb59Z0OX7g ELvgxicfeWK+R0zzyYb6EtC82PT12we1xxvbbpsGXE2lBtNQDNO1h8sWTNbw2v74ksGA jOXKT9DNkfLmAAdDkD0F+sztTtCM57px0ZbAADVTSyQUDIXzKYvuYmnCqopslEcpxrRx ljIuKhElkkizJAcI6cYVHgOgaD8fOcRH89VYwrHJtQMdRdT59aXhAoiqAddXF0nvX1av Mpglov3gqeSNmK+FJ2hRKGHsDeGPwxabKqgr2ZpeFUdLkPlW6jYQm8WxNZQia609cPl2 vLig== X-Gm-Message-State: ALQs6tBIsKy8ZzmmcZq7M5QljyI7DMsADkp/D6lnT1LUsK6ufI6/rNuY OUAmOVzVsrFM5KPowvWL7J1VmA== X-Google-Smtp-Source: AIpwx49APDwObntx5nqIYduLnUqFHJ9uO8er7zd/xg4zA+SPT5M9mjg9bXdg4lEuNh+gwGCDn7EAgw== X-Received: by 10.98.209.92 with SMTP id t28mr824275pfl.249.1523946500450; Mon, 16 Apr 2018 23:28:20 -0700 (PDT) Received: from localhost ([122.171.77.91]) by smtp.gmail.com with ESMTPSA id c66sm26041199pfc.56.2018.04.16.23.28.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 23:28:19 -0700 (PDT) From: Viresh Kumar To: Rob Herring , Frank Rowand Cc: Viresh Kumar , Vincent Guittot , Stephen Boyd , devicetree@vger.kernel.org Subject: [PATCH V3] of: Don't create device for OPP tables Date: Tue, 17 Apr 2018 11:57:34 +0530 Message-Id: <832f494b89b80c97702bee084bab7000a3ec0854.1523946361.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: <152389202198.51482.3779874474342173946@swboyd.mtv.corp.google.com> References: <152389202198.51482.3779874474342173946@swboyd.mtv.corp.google.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The OPP tables are present as separate nodes, whose phandle is used in the "operating-points-v2" property of devices. Currently the OF core creates a device for the OPP table unconditionally, which is not used by any kernel code. This patch creates another OF device_id table for the nodes which must be skipped while creating devices and OPP is the only user of it for now. Reported-by: Stephen Boyd Signed-off-by: Viresh Kumar Reviewed-by: Stephen Boyd --- V2->V3: - Staticize of_skipped_node_table V1->V2: - Added Reviewed-by from Stephen. - Created a table for nodes to be skipped. drivers/of/platform.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index c00d81dfac0b..d75050b85d0c 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -32,6 +32,11 @@ const struct of_device_id of_default_bus_match_table[] = { {} /* Empty terminated list */ }; +static const struct of_device_id of_skipped_node_table[] = { + { .compatible = "operating-points-v2", }, + {} /* Empty terminated list */ +}; + static int of_dev_node_match(struct device *dev, void *data) { return dev->of_node == data; @@ -356,6 +361,12 @@ static int of_platform_bus_create(struct device_node *bus, return 0; } + /* Skip nodes for which we don't want to create devices */ + if (unlikely(of_match_node(of_skipped_node_table, bus))) { + pr_debug("%s() - skipping %pOF node\n", __func__, bus); + return 0; + } + if (of_node_check_flag(bus, OF_POPULATED_BUS)) { pr_debug("%s() - skipping %pOF, already populated\n", __func__, bus);