From patchwork Fri Oct 13 07:48:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 10003623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC4DB60325 for ; Fri, 13 Oct 2017 07:49:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9DA628FF1 for ; Fri, 13 Oct 2017 07:49:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9825128FF4; Fri, 13 Oct 2017 07:49:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8155D28FF1 for ; Fri, 13 Oct 2017 07:49:50 +0000 (UTC) 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=LusOMU8KLD8y8ZC09hs7eQSuHJHB+vnsH+0M9It5Sxc=; b=S+8J3G1L8pzPMUqwS9h2pX639j ZjsMIlOffPgpVPPb0TGi3GJF6iSgJHJu+ZNB4wLNrKfpqEW5JcMFPvDhmWQQvqytRWq11FPJYIz0e 4WPg/1+lR7ZE1mlhiVsJgPWlMn7ZVRBTdaxWdvOKNeU4tcHlCelvQcEN9qyMze5RC8+B3CAeD1XIo 2RJ4s03wej1FJ7VXNcc3a5dKiDrFK9QnASbb0gqxqvgm21otqo9Kpfc9RPMSreXWia+yRSf3h2oEQ UH35U9vkUH7EAM9f/r9ZOzYhsJYpZwfyaeu2BmjhojtOmZjgyoWcZ/GtsHu9+3++DvAqr0nffJbmH Jl1T4RMw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2uii-0002JL-Bd; Fri, 13 Oct 2017 07:49:24 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2uiN-0001w5-I6 for linux-arm-kernel@lists.infradead.org; Fri, 13 Oct 2017 07:49:06 +0000 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20171013074836epoutp03ade00f83c464e9278e2ad71f498d762f~tEbRxeHqS1693616936epoutp032; Fri, 13 Oct 2017 07:48:36 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.69]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20171013074836epcas1p308009ce81728f8bce4cc71eff2fc9522~tEbRZlySV0319403194epcas1p3N; Fri, 13 Oct 2017 07:48:36 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 84.FA.04372.4DF60E95; Fri, 13 Oct 2017 16:48:36 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20171013074836epcas2p4e70bca2ebe9446353abf5c14a9d16460~tEbREYxdi1807918079epcas2p45; Fri, 13 Oct 2017 07:48:36 +0000 (GMT) X-AuditID: b6c32a47-499ff70000001114-24-59e06fd4b55c Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id E6.CA.06856.3DF60E95; Fri, 13 Oct 2017 16:48:36 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OXR00LHA4CULS20@mmp2.samsung.com>; Fri, 13 Oct 2017 16:48:35 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com Subject: [PATCH v4 7/8] PM / devfreq: Define the constant governor name Date: Fri, 13 Oct 2017 16:48:23 +0900 Message-id: <1507880904-31956-8-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1507880904-31956-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCKsWRmVeSWpSXmKPExsWy7bCmqe6V/AeRBgf3SVlMvHGFxeL6l+es FpPuT2Cx6H/8mtni/PkN7BZnm96wW2x6fI3V4vKuOWwWn3uPMFrMOL+PyeJ24wo2i8cr3rI7 8Hgs3vOSyWPTqk42j81L6j36tqxi9Pi8SS6ANSrVJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7U zMBQ19DSwlxJIS8xN9VWycUnQNctMwfoPCWFssScUqBQQGJxsZK+nU1RfmlJqkJGfnGJrVK0 oaGRnqGBuZ6RkZGeiXGslZEpUElCakb36UtMBXN0K7ZsWcTcwHhIrYuRk0NCwETi/aZHjF2M XBxCAjsYJVonT4RyvjNKTLo1kRWmavb5iewQiQ2MEtsP7oNyfjBKHN3TzARSxSagJbH/xQ02 EFtEIECic+0qJpAiZoGpTBLbps5kBEkIC7hLLDt8GayBRUBVYuKfv8wgNq+Aq8SpTTOYIN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piZVVqUX5 8UWlOanFhxilOViUxHn5849FCgmkJ5akZqemFqQWwWSZODilGhgPfk8K9D/3V+CHWSCr277A Q95vz8pFctluX7ug5PQRG0uWFNlmta64hPqmlbtqp1ZYeanIvD92re6D0AW5x4Y+C4z2/5f6 vWKu3eak3srXe72OO/LFfA6u2Xi7atvdjXX+s15O2LP7S9C5Z/ETl4TGb/hfaVB380Ha3aCl dXETM70WiUWXit5QYinOSDTUYi4qTgQAxdnuUjcCAAA= X-CMS-MailID: 20171013074836epcas2p4e70bca2ebe9446353abf5c14a9d16460 X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20171013074836epcas2p4e70bca2ebe9446353abf5c14a9d16460 X-RootMTR: 20171013074836epcas2p4e70bca2ebe9446353abf5c14a9d16460 References: <1507880904-31956-1-git-send-email-cw00.choi@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171013_004903_766785_757D3445 X-CRM114-Status: GOOD ( 14.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , inki.dae@samsung.com, Kukjin Kim , chanwoo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 Prior to that, the devfreq device uses the governor name when adding the itself. In order to prevent the mistake used the wrong governor name, this patch defines the governor name as a constant and then uses them instead of using the string directly. Signed-off-by: Chanwoo Choi Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: MyungJoo Ham --- drivers/devfreq/exynos-bus.c | 5 +++-- drivers/devfreq/governor_passive.c | 2 +- drivers/devfreq/governor_performance.c | 2 +- drivers/devfreq/governor_powersave.c | 2 +- drivers/devfreq/governor_simpleondemand.c | 2 +- drivers/devfreq/governor_userspace.c | 2 +- drivers/devfreq/rk3399_dmc.c | 2 +- include/linux/devfreq.h | 7 +++++++ 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 49f68929e024..c25658b26598 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -436,7 +436,8 @@ static int exynos_bus_probe(struct platform_device *pdev) ondemand_data->downdifferential = 5; /* Add devfreq device to monitor and handle the exynos bus */ - bus->devfreq = devm_devfreq_add_device(dev, profile, "simple_ondemand", + bus->devfreq = devm_devfreq_add_device(dev, profile, + DEVFREQ_GOV_SIMPLE_ONDEMAND, ondemand_data); if (IS_ERR(bus->devfreq)) { dev_err(dev, "failed to add devfreq device\n"); @@ -488,7 +489,7 @@ static int exynos_bus_probe(struct platform_device *pdev) passive_data->parent = parent_devfreq; /* Add devfreq device for exynos bus with passive governor */ - bus->devfreq = devm_devfreq_add_device(dev, profile, "passive", + bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, passive_data); if (IS_ERR(bus->devfreq)) { dev_err(dev, diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index 673ad8cc9a1d..3bc29acbd54e 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c @@ -183,7 +183,7 @@ static int devfreq_passive_event_handler(struct devfreq *devfreq, } static struct devfreq_governor devfreq_passive = { - .name = "passive", + .name = DEVFREQ_GOV_PASSIVE, .immutable = 1, .get_target_freq = devfreq_passive_get_target_freq, .event_handler = devfreq_passive_event_handler, diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c index c72f942f30a8..4d23ecfbd948 100644 --- a/drivers/devfreq/governor_performance.c +++ b/drivers/devfreq/governor_performance.c @@ -42,7 +42,7 @@ static int devfreq_performance_handler(struct devfreq *devfreq, } static struct devfreq_governor devfreq_performance = { - .name = "performance", + .name = DEVFREQ_GOV_PERFORMANCE, .get_target_freq = devfreq_performance_func, .event_handler = devfreq_performance_handler, }; diff --git a/drivers/devfreq/governor_powersave.c b/drivers/devfreq/governor_powersave.c index 0c6bed567e6d..0c42f23249ef 100644 --- a/drivers/devfreq/governor_powersave.c +++ b/drivers/devfreq/governor_powersave.c @@ -39,7 +39,7 @@ static int devfreq_powersave_handler(struct devfreq *devfreq, } static struct devfreq_governor devfreq_powersave = { - .name = "powersave", + .name = DEVFREQ_GOV_POWERSAVE, .get_target_freq = devfreq_powersave_func, .event_handler = devfreq_powersave_handler, }; diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index ae72ba5e78df..28e0f2de7100 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -125,7 +125,7 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq, } static struct devfreq_governor devfreq_simple_ondemand = { - .name = "simple_ondemand", + .name = DEVFREQ_GOV_SIMPLE_ONDEMAND, .get_target_freq = devfreq_simple_ondemand_func, .event_handler = devfreq_simple_ondemand_handler, }; diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c index 77028c27593c..080607c3f34d 100644 --- a/drivers/devfreq/governor_userspace.c +++ b/drivers/devfreq/governor_userspace.c @@ -87,7 +87,7 @@ static ssize_t show_freq(struct device *dev, struct device_attribute *attr, NULL, }; static const struct attribute_group dev_attr_group = { - .name = "userspace", + .name = DEVFREQ_GOV_USERSPACE, .attrs = dev_entries, }; diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c index 1b89ebbad02c..5dfbfa3cc878 100644 --- a/drivers/devfreq/rk3399_dmc.c +++ b/drivers/devfreq/rk3399_dmc.c @@ -431,7 +431,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev) data->devfreq = devm_devfreq_add_device(dev, &rk3399_devfreq_dmc_profile, - "simple_ondemand", + DEVFREQ_GOV_SIMPLE_ONDEMAND, &data->ondemand_data); if (IS_ERR(data->devfreq)) return PTR_ERR(data->devfreq); diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 5dc6190e479c..682419a32aa3 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -19,6 +19,13 @@ #define DEVFREQ_NAME_LEN 16 +/* DEVFREQ governor name */ +#define DEVFREQ_GOV_SIMPLE_ONDEMAND "simple_ondemand" +#define DEVFREQ_GOV_PERFORMANCE "performance" +#define DEVFREQ_GOV_POWERSAVE "powersave" +#define DEVFREQ_GOV_USERSPACE "userspace" +#define DEVFREQ_GOV_PASSIVE "passive" + /* DEVFREQ notifier interface */ #define DEVFREQ_TRANSITION_NOTIFIER (0)