From patchwork Mon Dec 9 10:49:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= X-Patchwork-Id: 11279093 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 02381138D for ; Mon, 9 Dec 2019 10:51:33 +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 D1EA8207FD for ; Mon, 9 Dec 2019 10:51:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iQCrDv+W"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="RYLJ8a3h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1EA8207FD 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-arm-kernel-bounces+patchwork-linux-arm=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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version: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=LdUK2vJVDMxfeO/0eO9ukh3GsBMOGkR6++M4a5pXtgA=; b=iQCrDv+WKeFu3s vBi57AyEfFLDvmj1quUtUoZtYlqB8uILm+NyWoHY55w1kzT/TYwCQiRH5LsePTaVElGz1w4xeCQiY sdEoqzsRhKm2VGdvfj6kaV9CWXU/NaArSOSp5QGVoCPVJ4kchZJVz39PMFcGAdaTZgeajpbXDjJ3N ezNvXdOr+m/jCFcjbkUpQ7fFscyeT6jA7nQGiFgdOawWnFl6dFPOTSYFV/YL8lQ5iS0e1bF801/bE P3zOupQaCP8jflFMEoQXqZgEWOpOkegCEkKFCeDg5UB5QwsA4MAZvKL7azGvEKfzIIB/vczGQ6yEK fleUM0fN4Hq7nJpCNeHQ==; 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 1ieGdY-00049O-CJ; Mon, 09 Dec 2019 10:51:32 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ieGcd-0003FV-Oo for linux-arm-kernel@lists.infradead.org; Mon, 09 Dec 2019 10:50:39 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20191209105033euoutp02a1f79af62ac763ce07ecd2d4b7216d0f~erlzS-2373098730987euoutp02Z for ; Mon, 9 Dec 2019 10:50:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191209105033euoutp02a1f79af62ac763ce07ecd2d4b7216d0f~erlzS-2373098730987euoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1575888633; bh=bQfaK3H9O2avQYC2R28z2VtVDLkeXfgJH5IcB1mxqe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYLJ8a3hTe/OOoTe9JbniNjFuPGeqCDInx4ulNCXQskG8JPUZhidChrlGvVvHItRH X6y/jgZe/IbCvZa7Buog2RzLUnI0hVijeDUBrTEcUojHmcp5s1IuT4Gz/JOeQHtshx VRu1DwU93/nf9Q+x5kv1Dmci3vWwV6EgGDsI9low= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20191209105033eucas1p1dfa9ba65a240fe8b871e8e8727ddba22~erlzCvAJH0954309543eucas1p1k; Mon, 9 Dec 2019 10:50:33 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 2B.34.60698.8F62EED5; Mon, 9 Dec 2019 10:50:33 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20191209105032eucas1p13fa6c46a1e80cdda68ab4bac3e008b8f~erlypQkhy0955109551eucas1p1f; Mon, 9 Dec 2019 10:50:32 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20191209105032eusmtrp16fb547a39e6f6d1b5dd5f8f55890489b~erlyokVPQ2125621256eusmtrp1X; Mon, 9 Dec 2019 10:50:32 +0000 (GMT) X-AuditID: cbfec7f5-a29ff7000001ed1a-87-5dee26f8fddd Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A1.D7.07950.8F62EED5; Mon, 9 Dec 2019 10:50:32 +0000 (GMT) Received: from AMDC3555.digital.local (unknown [106.120.51.67]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191209105031eusmtip185d18721653d060ac1dedd6a86189480~erlx1udGa2957929579eusmtip1n; Mon, 9 Dec 2019 10:50:31 +0000 (GMT) From: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v3 2/4] devfreq: exynos-bus: Extract exynos_bus_profile_init_passive() Date: Mon, 9 Dec 2019 11:49:00 +0100 Message-Id: <20191209104902.11904-3-a.swigon@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191209104902.11904-1-a.swigon@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRj229nZjquN41R8s1AbZCWklUVfGpERtiJIoigsqZkHFa/tqGV/ Mk0xb3nB3CxNTJdpeZkXVEhjWt6SYYYZpossvOXEdJUSlvNo+e95n8v7fC98FCHtIe2p4PAo RhmuCJUJRPyG1wv6XQvORr/dxZ7YUJiIcI2qisTv58dInG3I5OOi7yoS3xudIrBeXy3EvfHf hLhseJbE2tEBEvc3PxTgufR2hFX6Fh5+3j4sxEO3ywRYlTMhOELLteV3BfLaklvyGmMjT55R V47kc1oHH9JXdCiACQ2OYZRuh6+IgipHpgWRcZtuLKVX8+NQl00KsqSA3gemcQ1KQSJKSpch yNclkNwwj2BCl8vjhjkEyWU6Yi2S+uLdauQJgvqcFt6/yLNFAzK7BLQXZOd+EpoFGzoRQZ/+ A2EeCLqbB+NJ8aTZZU1fgM7WSZ4Z8+ltYDLOrXSI6YNQOvRWyPU5QkX1yxXekvaAWU2vkPNY QZf6C9+MiWVPQv2DlQKgJ4Qw83gYceFjUFs4RnLYGiY76laXboGenDQ+h1n42mQguXAcAq2m ffVST2jr6FsWqOWGnVDV7MbRXjDYkYXMNNASGJy24t4ggeyGPIKjxZCcJOWgDJrVEi4IEF8x sLpbDsaCAiITbc1fd0z+umPy/9cWIaIc2THRbFggw7qHM9ddWUUYGx0e6Ho1IkyLlr9Yz1KH qRG1/PbXIZpCso1iJ49pPympiGFjw3QIKEJmIy7JmvSTigMUsTcZZcRlZXQow+rQZoovsxO7 F0/4SelARRQTwjCRjHJN5VGW9nEolcB/ks/Z1ZVGJgRYRNk692obkx45Nu2wkMSqCk+aND62 p5ReRYuakdnjLg3y+wm5ToyoPz4lVVytvSTqlj0ddTrftn9pw9m9hEuM90W1RCT59SojpDNw 5gSv0lv5+dpQlr86cXvrgTtHsdF3yeFNmvuPMz/ztKd9Kp0/To0PZMr4bJBijwuhZBV/AfBy b5VeAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsVy+t/xu7o/1N7FGvQsVLS4P6+V0WLjjPWs Fte/PGe1mHR/AovFgk8zWC36H79mtjh/fgO7xdmmN+wWK+5+ZLXY9Pgaq8XlXXPYLD73HmG0 mHF+H5PF2iN32S1uN65gs5gx+SWbg4DHplWdbB6bl9R7bHy3g8mjb8sqRo/Pm+QCWKP0bIry S0tSFTLyi0tslaINLYz0DC0t9IxMLPUMjc1jrYxMlfTtbFJSczLLUov07RL0Mtbde8tW0CBZ 8a93A0sD40mRLkZODgkBE4nuvVcYQWwhgaWMEg3zCyHiEhIf199ghbCFJf5c62LrYuQCqvnE KHF00nwmkASbgKPEpKkP2EESIgKdjBLrl01nAnGYBW4wSTRtecfSxcjBISwQJnF3nw9IA4uA qsTXd5+ZQWxeAUuJpbcvsUNskJdYveEAWJxTwEri47Kz7BAXWUrMXbiaBaJeUOLkzCdgI5kF 1CXWzxMCCTMDtTZvnc08gVFwFpKqWQhVs5BULWBkXsUoklpanJueW2ykV5yYW1yal66XnJ+7 iREYmduO/dyyg7HrXfAhRgEORiUeXgWrt7FCrIllxZW5hxglOJiVRHiXTHwVK8SbklhZlVqU H19UmpNafIjRFOi1icxSosn5wKSRVxJvaGpobmFpaG5sbmxmoSTO2yFwMEZIID2xJDU7NbUg tQimj4mDU6qB8eCxv2fCVuqu5T5WK6gglbzh5NHihW5l/8w5jn1cYhs88+r2DJmSC9q/Pnpm nT+Yeni1Y7XoDkOZliSBEJnGs6f3zY64nVDr9FK6oXmdhEpt4XTbF0xP67affxY1+5gI19Yj PeoqnT+bPuhpzd22NLIyqCR8uUigyUZl9T6+qV7iR2YK2zy+p8RSnJFoqMVcVJwIADIpCafi AgAA X-CMS-MailID: 20191209105032eucas1p13fa6c46a1e80cdda68ab4bac3e008b8f X-Msg-Generator: CA X-RootMTR: 20191209105032eucas1p13fa6c46a1e80cdda68ab4bac3e008b8f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191209105032eucas1p13fa6c46a1e80cdda68ab4bac3e008b8f References: <20191209104902.11904-1-a.swigon@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191209_025035_957068_082E1548 X-CRM114-Status: GOOD ( 14.72 ) 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 [210.118.77.12 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: b.zolnierkie@samsung.com, k.konieczny@samsung.com, sw0312.kim@samsung.com, =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , krzk@kernel.org, inki.dae@samsung.com, cw00.choi@samsung.com, kyungmin.park@samsung.com, kgene@kernel.org, myungjoo.ham@samsung.com, leonard.crestez@nxp.com, m.szyprowski@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds a new static function, exynos_bus_profile_init_passive(), extracted from exynos_bus_probe(). Signed-off-by: Artur Świgoń --- drivers/devfreq/exynos-bus.c | 70 +++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index b8ca6b9f4b82..19d9f9f8ced2 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -345,13 +345,51 @@ static int exynos_bus_profile_init(struct exynos_bus *bus, return ret; } +static int exynos_bus_profile_init_passive(struct exynos_bus *bus, + struct devfreq_dev_profile *profile) +{ + struct device *dev = bus->dev; + struct devfreq_passive_data *passive_data; + struct devfreq *parent_devfreq; + int ret = 0; + + /* Initialize the struct profile and governor data for passive device */ + profile->target = exynos_bus_target; + profile->exit = exynos_bus_passive_exit; + + /* Get the instance of parent devfreq device */ + parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); + if (IS_ERR(parent_devfreq)) { + ret = -EPROBE_DEFER; + goto err; + } + + passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); + if (!passive_data) { + ret = -ENOMEM; + goto err; + } + passive_data->parent = parent_devfreq; + + /* Add devfreq device for exynos bus with passive governor */ + bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, + passive_data); + if (IS_ERR(bus->devfreq)) { + dev_err(dev, + "failed to add devfreq dev with passive governor\n"); + ret = PTR_ERR(bus->devfreq); + goto err; + } + +err: + return ret; +} + static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node, *node; struct devfreq_dev_profile *profile; - struct devfreq_passive_data *passive_data; - struct devfreq *parent_devfreq; struct exynos_bus *bus; int ret, max_state; unsigned long min_freq, max_freq; @@ -397,33 +435,9 @@ static int exynos_bus_probe(struct platform_device *pdev) goto out; passive: - /* Initialize the struct profile and governor data for passive device */ - profile->target = exynos_bus_target; - profile->exit = exynos_bus_passive_exit; - - /* Get the instance of parent devfreq device */ - parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0); - if (IS_ERR(parent_devfreq)) { - ret = -EPROBE_DEFER; + ret = exynos_bus_profile_init_passive(bus, profile); + if (ret < 0) goto err; - } - - passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL); - if (!passive_data) { - ret = -ENOMEM; - goto err; - } - passive_data->parent = parent_devfreq; - - /* Add devfreq device for exynos bus with passive governor */ - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE, - passive_data); - if (IS_ERR(bus->devfreq)) { - dev_err(dev, - "failed to add devfreq dev with passive governor\n"); - ret = PTR_ERR(bus->devfreq); - goto err; - } out: max_state = bus->devfreq->profile->max_state;