From patchwork Fri Dec 20 00:24:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 11304603 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 6998614B7 for ; Fri, 20 Dec 2019 00:20:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E54942467E for ; Fri, 20 Dec 2019 00:20:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RGdTG0jl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ai9RvWqf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E54942467E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=3Ml03IWX7pOsWAvGR9pBYar1HwY6+bb/q7XT1wjJl18=; b=RGdTG0jlrvzjVUENvqzmcEakpO yG4NqC+zdfDFXo0p9g4ZJ4I+BYuMndzdcfyL7AioDIu/k/oJD4nj2mXKOLSwu6Sc2n4fGsvPUPDzq u9gp6WLkxZAPbPQqiRSIel6e57zQW8JqWSzsWPdVOKa4g/QefQDTXFRj8X4iHevl+gmL+S4eOxz3V mBmPfuWghTBI9+FAtM7tFPH64qyzLYZ9N/lHrcaMwLmbZy5WSYRBDHuCgOtbwechGkazsfbS5Tq4T lLZpTYHX81qLCNuuQ9IjUMbH+gOjJYhIVMeN3OvWjM5RGYAAX1kLUAWAikC3SO/drYB37LWGXOiL3 xJneM0sg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ii61V-0000wJ-Ni; Fri, 20 Dec 2019 00:20:05 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ii5zj-0007SI-Kb for linux-rockchip@lists.infradead.org; Fri, 20 Dec 2019 00:18:20 +0000 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20191220001804epoutp03316aa9d77156a7f560deb6d1cb1495f6~h7Dtiu3gK1243312433epoutp03i for ; Fri, 20 Dec 2019 00:18:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20191220001804epoutp03316aa9d77156a7f560deb6d1cb1495f6~h7Dtiu3gK1243312433epoutp03i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576801084; bh=sAv5KFtPYXy7xSog3ojb9vcjFNw1ESh0hk+USCZHJj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ai9RvWqf1teqR6R1DdhTirxAEp5lslIcNqy14LNygF/PEnSQtewasHeTZPpE+8mEB 39P8QInakEuG4CBoFvBgHvZorEgFmDyVG+URhE+8299bvxAuYQnJQ/VG4bnil6LKfS RSjJoxK9hbAeTGfQWVK5jdtPKeJT9LHPKr6oEjUA= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20191220001803epcas1p4a8876dff2ae81370068c87ca4173a8ac~h7Ds5Q_Ag2970029700epcas1p46; Fri, 20 Dec 2019 00:18:03 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.153]) by epsnrtp1.localdomain (Postfix) with ESMTP id 47f8Tg5hhszMqYlr; Fri, 20 Dec 2019 00:17:59 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 8D.0E.48019.7331CFD5; Fri, 20 Dec 2019 09:17:59 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20191220001759epcas1p4ce1c2017937a35de84eab720b9732df0~h7DpC0qNa0539105391epcas1p4T; Fri, 20 Dec 2019 00:17:59 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20191220001759epsmtrp11c6a7053121e5a05c63c31650e5d1f92~h7DpB7FGz1705617056epsmtrp1P; Fri, 20 Dec 2019 00:17:59 +0000 (GMT) X-AuditID: b6c32a38-257ff7000001bb93-62-5dfc133761e8 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id ED.6C.06569.7331CFD5; Fri, 20 Dec 2019 09:17:59 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191220001759epsmtip1fa82730305a941bd00b4c1688e04da03~h7Do1fCuM2006320063epsmtip12; Fri, 20 Dec 2019 00:17:59 +0000 (GMT) From: Chanwoo Choi To: robh+dt@kernel.org, krzk@kernel.org, heiko@sntech.de, leonard.crestez@nxp.com, lukasz.luba@arm.com Subject: [PATCH v2 02/11] PM / devfreq: Remove devfreq_get_devfreq_by_phandle function Date: Fri, 20 Dec 2019 09:24:21 +0900 Message-Id: <20191220002430.11995-3-cw00.choi@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191220002430.11995-1-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFJsWRmVeSWpSXmKPExsWy7bCmrq658J9Yg+Ur9Czuz2tltLj+5Tmr xfwj51gt/j96zWrR//g1s8X58xvYLc42vWG3WHH3I6vFpsfXWC0u75rDZvG59wijxacH/5kt Zpzfx2SxsKmF3WLtkbvsFkuvX2SyuN24gs2ide8RdgchjzXz1jB6bFrVyeaxeUm9x8Z3O5g8 +rasYvTYfm0es8fnTXIB7FHZNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJ uam2Si4+AbpumTlAbygplCXmlAKFAhKLi5X07WyK8ktLUhUy8otLbJVSC1JyCiwL9IoTc4tL 89L1kvNzrQwNDIxMgQoTsjM2fLzOVtCkUPFp4nv2BsZ3Ul2MHBwSAiYSNybndjFycQgJ7GCU uHtiKzuE84lR4s3Nd4wQzjdGiT9PLrN2MXKCdVzZPJ8ZIrGXUWLRkfMsEM4XoKoD/5lBqtgE tCT2v7jBBmKLCGRIzHwN0s3FwSzwkUmia9tdsISwQIRE98E7YA0sAqoSE5/MArN5Bawktn7s ZoZYJy+xesMBMJtTwFpiy7OH7BDx32wST17IQ9guEisf/WSEsIUlXh3fAlUjJfGyvw3KrpZY efIIG8gREgIdjBJb9l+A+sdYYv/SyUyg0GAW0JRYv0sfIqwosfP3XLCZzAJ8Eu++9rBCAoxX oqNNCKJEWeLyg7tMELakxOL2TjYI20Oi68VJaDj2MUqcP3mdfQKj3CyEDQsYGVcxiqUWFOem pxYbFpggR9kmRnA61bLYwbjnnM8hRgEORiUeXoe037FCrIllxZW5hxglOJiVRHhvd/yMFeJN SaysSi3Kjy8qzUktPsRoCgzJicxSosn5wFSfVxJvaGpkbGxsYWJoZmpoqC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4EACnv8JV3AgAA X-CMS-MailID: 20191220001759epcas1p4ce1c2017937a35de84eab720b9732df0 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20191220001759epcas1p4ce1c2017937a35de84eab720b9732df0 References: <20191220002430.11995-1-cw00.choi@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191219_161816_070470_94721107 X-CRM114-Status: GOOD ( 16.33 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [203.254.224.33 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [203.254.224.33 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, a.swigon@samsung.com, linux-kernel@vger.kernel.org, cw00.choi@samsung.com, kyungmin.park@samsung.com, myungjoo.ham@samsung.com, kgene@kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Previously, devfreq core support 'devfreq' property in order to get the devfreq device by phandle. But, 'devfreq' property name is not proper on devicetree binding because this name doesn't mean the any h/w attribute. The devfreq core hand over the right to decide the property name for getting the devfreq device on devicetree. Each devfreq driver will decide the property name on devicetree binding and then get the devfreq device by using devfreq_get_devfreq_by_node(). Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 35 ----------------------------------- drivers/devfreq/exynos-bus.c | 12 +++++++++++- include/linux/devfreq.h | 8 -------- 3 files changed, 11 insertions(+), 44 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index cb8ca81c8973..c3d3c7c802a0 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -991,48 +991,13 @@ struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node) return ERR_PTR(-ENODEV); } - -/* - * devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree - * @dev - instance to the given device - * @index - index into list of devfreq - * - * return the instance of devfreq device - */ -struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) -{ - struct device_node *node; - struct devfreq *devfreq; - - if (!dev) - return ERR_PTR(-EINVAL); - - if (!dev->of_node) - return ERR_PTR(-EINVAL); - - node = of_parse_phandle(dev->of_node, "devfreq", index); - if (!node) - return ERR_PTR(-ENODEV); - - devfreq = devfreq_get_devfreq_by_node(node); - of_node_put(node); - - return devfreq; -} - #else struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node) { return ERR_PTR(-ENODEV); } - -struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) -{ - return ERR_PTR(-ENODEV); -} #endif /* CONFIG_OF */ EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_node); -EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_phandle); /** * devm_devfreq_remove_device() - Resource-managed devfreq_remove_device() diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 7f5917d59072..1bc4e3c81115 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -86,6 +86,16 @@ static int exynos_bus_get_event(struct exynos_bus *bus, return ret; } +static struct devfreq *exynos_bus_get_parent_devfreq(struct device_node *np) +{ + struct device_node *node = of_parse_phandle(np, "devfreq", 0); + + if (!node) + return ERR_PTR(-ENODEV); + + return devfreq_get_devfreq_by_node(node); +} + /* * devfreq function for both simple-ondemand and passive governor */ @@ -353,7 +363,7 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus, profile->exit = exynos_bus_passive_exit; /* Get the instance of parent devfreq device */ - parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); + parent_devfreq = exynos_bus_get_parent_devfreq(dev->of_node); if (IS_ERR(parent_devfreq)) return -EPROBE_DEFER; diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 1dccc47acbce..a4351698fb64 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -254,8 +254,6 @@ extern void devm_devfreq_unregister_notifier(struct device *dev, struct notifier_block *nb, unsigned int list); extern struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node); -extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, - int index); #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) /** @@ -413,12 +411,6 @@ static inline struct devfreq *devfreq_get_devfreq_by_node(struct device_node *no return ERR_PTR(-ENODEV); } -static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, - int index) -{ - return ERR_PTR(-ENODEV); -} - static inline int devfreq_update_stats(struct devfreq *df) { return -EINVAL;