Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4936519ybl; Mon, 9 Dec 2019 20:15:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyNtvxN0G9fr6/U2DI1Loi6ytT+z0SEQ1wmwat7BJzUFmBDx3vYK4GzPG+8ify1PcLBGnSr X-Received: by 2002:a9d:7085:: with SMTP id l5mr25277897otj.25.1575951330841; Mon, 09 Dec 2019 20:15:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575951330; cv=none; d=google.com; s=arc-20160816; b=hLYvc0sI61tsYUwHHkmxPo6691AqOHJZ3QVg7+B3gg9nYMkns4tN0EEgA0JCED+uVX U/iF6+cLDQ3q/4fx9qXliDQpcsNg+0POcvMPRFSL7tqyynxBULnpp90hOcsREvxSajHh 9mU9kvYwjMBwOAAwKit7DWql79Ed3fxwDDlHvO3tmv5R7djbzinIhjZjyiirXxHkQJb2 ZWx+bC/h3Y/SXlMCFNgTWE5PX5BIYL10usqd7BVUAXBvE3fP1p4f1r0qFprP9J31ayQK XYyuXr4hILqZPx7/vxCPR4/lXrfEt7rkJEsHcr1eShl52LiaD1BZLXMS1MvpZvyOwhXY gmyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=qHDmCpWE+HvyeD/hUW+yp7Qx/0mA9AfvYxWPVGikIw8=; b=Y/Vw1O97edZEefVp/ApY3qBDzksuPr0F/R8qaN0A2u7Hw+4VkeCvIA6asWTERt5SjI fUVap5CBHXYir5DQKAq9sv9xJ5VNureRUSp4o8Bdw5dircQspu0w+MUGhaccn3xpF3NV q//yN87gG3n6ViJ9AnjH3y0QwaxJ8YlSVaGFPNabVAxgXB5WBZ8nicUuY/B7NpzHa6/W 5KkotBGAN0Er0X59T7McAS7A1uFFgMJwxPt2skKz9UWvE8Ex7x+BvtMldaSvcL5q/LcR J2mZd/uoQ+Or8njnkphRyAFEdVEXbIprxTyvYno7rR+T4BagUiWhS5kYouWt+1Bqz23S tvCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ky1ii+Iw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si1298880otp.161.2019.12.09.20.15.18; Mon, 09 Dec 2019 20:15:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ky1ii+Iw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbfLJEOd (ORCPT + 99 others); Mon, 9 Dec 2019 23:14:33 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:25683 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfLJEOd (ORCPT ); Mon, 9 Dec 2019 23:14:33 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20191210041430epoutp02f61765f34ae400d8d6183ebe3b3ecaf2~e51Sv4JzZ1235812358epoutp02U for ; Tue, 10 Dec 2019 04:14:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20191210041430epoutp02f61765f34ae400d8d6183ebe3b3ecaf2~e51Sv4JzZ1235812358epoutp02U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1575951270; bh=qHDmCpWE+HvyeD/hUW+yp7Qx/0mA9AfvYxWPVGikIw8=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Ky1ii+Iw79D2f/TCF0OP3klNuFHzrwCVkLFcNUxmiq0dS9uYaa37uGQZUUCr+FLrt J8b84JlhARrHifmuRiu5AKwBITU8B/HtILyeq5kav//1A5TUsba/fP/sB0Z+LxgKQE O+hFLoIS67b7F/yyAGfFrXfdhiZ4by039esqVSvo= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20191210041430epcas1p2fbfb7c6ead257ab53dfdb531254e3d76~e51Sb2fnA2987929879epcas1p2d; Tue, 10 Dec 2019 04:14:30 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.155]) by epsnrtp3.localdomain (Postfix) with ESMTP id 47X6C45V9MzMqYkw; Tue, 10 Dec 2019 04:14:24 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.C9.48019.0AB1FED5; Tue, 10 Dec 2019 13:14:24 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20191210041424epcas1p3fbfcee2a4776a151bc87c1e53cce7fef~e51MuZ8nJ1387213872epcas1p3a; Tue, 10 Dec 2019 04:14:24 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20191210041424epsmtrp12b6ffc213687e1b2e164b6e313771553~e51MtoSpP2236922369epsmtrp1x; Tue, 10 Dec 2019 04:14:24 +0000 (GMT) X-AuditID: b6c32a38-257ff7000001bb93-52-5def1ba0ed06 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 64.18.06569.F9B1FED5; Tue, 10 Dec 2019 13:14:23 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20191210041423epsmtip1b8178bea4c794f1bd1e105d67282c468~e51MbK6o32854928549epsmtip1R; Tue, 10 Dec 2019 04:14:23 +0000 (GMT) Subject: Re: [PATCH v3 2/4] devfreq: exynos-bus: Extract exynos_bus_profile_init_passive() To: =?UTF-8?B?QXJ0dXIgxZp3aWdvxYQ=?= , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, kgene@kernel.org, krzk@kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, k.konieczny@samsung.com, leonard.crestez@nxp.com From: Chanwoo Choi Organization: Samsung Electronics Message-ID: Date: Tue, 10 Dec 2019 13:20:49 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <20191209104902.11904-3-a.swigon@samsung.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLJsWRmVeSWpSXmKPExsWy7bCmru4C6fexBm29Ohb357UyWmycsZ7V YtL9CSwWCz7NYLXof/ya2eL8+Q3sFmeb3rBbrLj7kdVi0+NrrBaXd81hs/jce4TRYsb5fUwW a4/cZbe43biCzWLG5JdsDvwem1Z1snlsXlLvsfHdDiaPvi2rGD0+b5ILYI3KtslITUxJLVJI zUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLxCdB1y8wBulZJoSwxpxQoFJBYXKyk b2dTlF9akqqQkV9cYquUWpCS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SezLLVI 3y6BK2PeoTbGgn3SFa3r29gbGNvFuhg5OSQETCReLb7A3MXIxSEksJtR4urt3ewQCUmJaReP AiU4gGxhicOHiyFq3jJKPP70jwmkRlggRuLLvV52kISIwAFGic07Z4MlmAW+MEocfRIOYgsJ 7AVKXPEAsdkEtCT2v7jBBmLzCyhKXP3xmBHE5hWwk1jyZwPYYhYBVYm/24+xgNiiAmESO5c8 ZoKoEZQ4OfMJWJxTwEqi5+UBdohd6hJ/5l1ihrDFJW49mQ91g7xE89bZzBMYhWchaZ+FpGUW kpZZSFoWMLKsYpRMLSjOTc8tNiwwykst1ytOzC0uzUvXS87P3cQIjk4trR2MJ07EH2IU4GBU 4uH1sHsXK8SaWFZcmXuIUYKDWUmE93gbUIg3JbGyKrUoP76oNCe1+BCjNAeLkjivfP6xSCGB 9MSS1OzU1ILUIpgsEwenVAOj1J3KXZZ1vVnlVYWTpHn7/9VPlTlgGKG57iKfhHj7m8odLXzf pUS1fre/Yvqh8K6v/dvKWL6XSZoh4R/e8R3jFPLSbGHYNovr3UTe4suCqsWKc/T/nkmQTAgq /GycE8kUF63cP8eU73PjjweR9uqv2mYb82hWTy59Uvp4+6WNxpbGAvWfNymxFGckGmoxFxUn AgD2TbyqygIAAA== X-CMS-MailID: 20191210041424epcas1p3fbfcee2a4776a151bc87c1e53cce7fef X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20191209105032eucas1p13fa6c46a1e80cdda68ab4bac3e008b8f References: <20191209104902.11904-1-a.swigon@samsung.com> <20191209104902.11904-3-a.swigon@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/9/19 7:49 PM, Artur Świgoń wrote: > 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; > Applied it. Thanks. -- Best Regards, Chanwoo Choi Samsung Electronics