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: 133511 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp4374396ljb; Mon, 16 Apr 2018 23:28:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/WGtjctRMdrk2WvCkjKXcBMNIQ+je2vbaiSuQK1Jd0upRPbyBSyXlQC9T0OaSaCfxNRl+S X-Received: by 2002:a17:902:f24:: with SMTP id 33-v6mr913558ply.242.1523946508983; Mon, 16 Apr 2018 23:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523946508; cv=none; d=google.com; s=arc-20160816; b=ZBlm1DZ7yMjvqf0q/1ujELowbPC7BHDcEtqZQIKryEmZuwfzupbO0YPn4eB+bRBU0t 11fF5OJZZfWShnP9NaVbkwf1gQoA2sdGwp3m2Cx50k0KwsCM8Ssq26UGUH3sRp4q7fCg 1ybxeWzxt1+1M434Wlaxj6/kJ8dMoANOIt3swliczcCcL0jp+XFU3KIiQxaptnFofejn QaT/uN+qdz8OB7x4jqqSXt37zfPO5GPKuJHbHImvXTJkr6YbyaftO9y8BvZx3YJz8M8J jbSOTVlG/zZYL3M9pTWloKtFBU1VI9ZbLWrX3GhLRbEEnwJfJgFXdadi2cxyM/KhxLh7 8+Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=U+xdi6U4IQ0wA7B1KzZqJQMQ71Z9zKlYpwa4Blzw52U=; b=MUwKm64LXbCozIxSPysKtrD/QVUVPtbirCdfmdd7TmIFbd5VmEbwE+9rxBrbbAWG1W jcrxH3U1Bfx+AB08niIq6TKXg1bZ7GKtyFVeUbmBAqBkahuwhktuCxhmzhmqXD9he0kS aFggdRUMOzUjvsxyhDZQGYDCYiexQpva/FAIEGVFtCT2lzlrC65rQx66XF9fgjrVSpSF u/gGd8iYUcgdj4nS/Bb8DChr6jVThJmAo4wYW/RkFWGJfKqLkHicn2cFLYwmhVRcE2JL BB8UR5P94sKZt+aS9FuZFzTd+zi9jaHTO0C/IcJa7xOUmoAzwQwvDmBuyR6wdWBraSbf lkQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Er3JBMpD; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y16si11996301pfm.142.2018.04.16.23.28.28; Mon, 16 Apr 2018 23:28:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Er3JBMpD; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbeDQG21 (ORCPT + 6 others); 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-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(+) -- 2.15.0.194.g9af6a3dea062 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);