From patchwork Sun Jun 7 18:55:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 11592093 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED51A13B1 for ; Sun, 7 Jun 2020 19:14:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB18E206D5 for ; Sun, 7 Jun 2020 19:14:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DiPzbUO/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB18E206D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0949C6E421; Sun, 7 Jun 2020 19:13:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85AA16E19A for ; Sun, 7 Jun 2020 18:57:47 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id n23so17764457ljh.7 for ; Sun, 07 Jun 2020 11:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IaLwBgEJHAnRll2My7iiWFVAnwuWkHTJFbXmtwzd9MY=; b=DiPzbUO/RDiI5W88efnkYO/TDHc8sDz6irKWYG6cR+jJVJYZU3bu6lqUog0lOOklg9 I7+Iksqx5pNyNqM7Ny2tzo/Fce9VuXs+LcQ2fzxgHnkJF8Vjl9O89CTu0+7gvJW0jfIw EKTf0bNuoxH7s3gR2T6CXJcSnQQHr5JByoImMrATC7Axf+g5Ej3jfb1kBE7RFo4cr7fP 4k2SX1ncwhwdCrgV+zKuPBikiS/I4Z16tzOMzaRNUEDIMq0WX6VReyY7ko8N9/NqZKYS Ls/bQZRLIPaLOKiyx1/9BhAj7FFfw3mrFEYE2rHrwAYlGBmDrTVPSc46kTA9nWP5hdga tJzQ== 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:mime-version:content-transfer-encoding; bh=IaLwBgEJHAnRll2My7iiWFVAnwuWkHTJFbXmtwzd9MY=; b=F/NDXNeJpe/9enE8Hzfg5TRK5620wUSAaFoE1j9TtMOVFUvccuyxfwS/pjTzZqhxkt fA2pUy++aJFm6y8UpoRI3QV6zqk5QU22c2PeRQ0LBctQnXV9gHlp0uDxNTxi306ImzWH 5xqEofJ3B0RB8SFdcTPSjXVXJuB6Fr8NCrw9LoOcFv3dSq+3qZTPWbuZ02V0AhLAI9Pp qJSuJ9GgVQmuEOV0MRAMzynYlhu0IZbSkBVDuh0cNh1/e0V99ReFGYGF2wfhxSqsbIUI rCJKghX6Xm8yZMRneWL6W9J/GPlbEhvSdXwmP1+NcPb5soibWjMGXXLb8dTQ6vJ+ytxf zrvQ== X-Gm-Message-State: AOAM530Lapb5LbE8oMzjLOJf2CjXQO0vFivTJfAcy5BjhFrhUZ/IVW7x UFToSqwQEHbKqVTXOR/PCW8= X-Google-Smtp-Source: ABdhPJxAx48J4/BOHbqmc66MSdgPZ+pfZ9D6AgeCtMQ5TzoOzTuCkJgFLzz27dDgT2Zp+G0iqqYJjw== X-Received: by 2002:a2e:974c:: with SMTP id f12mr7136792ljj.38.1591556265994; Sun, 07 Jun 2020 11:57:45 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:45 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Subject: [PATCH v3 27/39] interconnect: Relax requirement in of_icc_get_from_provider() Date: Sun, 7 Jun 2020 21:55:18 +0300 Message-Id: <20200607185530.18113-28-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 07 Jun 2020 19:13:00 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Artur Świgoń This patch relaxes the condition in of_icc_get_from_provider() so that it is no longer required to set #interconnect-cells = <1> in the DT. In case of the devfreq driver for exynos-bus, #interconnect-cells is always zero. Signed-off-by: Artur Świgoń [digetx@gmail.com: added cells_num checking for of_icc_xlate_onecell()] Signed-off-by: Dmitry Osipenko --- drivers/interconnect/core.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index e5f998744501..cb143421ca67 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -339,7 +339,7 @@ static struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec) struct icc_node *node = ERR_PTR(-EPROBE_DEFER); struct icc_provider *provider; - if (!spec || spec->args_count != 1) + if (!spec) return ERR_PTR(-EINVAL); mutex_lock(&icc_lock); @@ -967,6 +967,15 @@ EXPORT_SYMBOL_GPL(icc_nodes_remove); */ int icc_provider_add(struct icc_provider *provider) { + struct device_node *np = provider->dev->of_node; + u32 cells_num; + int err; + + err = of_property_read_u32(np, "#interconnect-cells", &cells_num); + if (WARN_ON(err)) + return err; + if (WARN_ON(provider->xlate == of_icc_xlate_onecell && cells_num != 1)) + return -EINVAL; if (WARN_ON(!provider->set)) return -EINVAL; if (WARN_ON(!provider->xlate))