Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10913083ybi; Thu, 25 Jul 2019 07:00:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVKFnee7GqL7q9WBzCucOQgm94+ua3WsaT6OpxSuLtZJZ8o93AzKlqahjEAWXpruOq/C78 X-Received: by 2002:a17:902:290b:: with SMTP id g11mr89547319plb.26.1564063240196; Thu, 25 Jul 2019 07:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564063240; cv=none; d=google.com; s=arc-20160816; b=SLQgXD+xfLyJ7Eed6ncBrEVgnbEkj/kYV374owVtLSMMfd3eAh3RDDBKBikN9iYi6R //g8J8x7YIWNxuzkHoczW2lyM5oNoziN9Y8kkSWAbdorcQhoVwjp5oDtEtj+CYMZorLk bBPaB5Hsjv197sUqPtvEQlN0eROkDaFanEZ50qGNx0/qbs5ZpKzGt3YA/czcy+EASk7r qSyZj2PmKhf3nDjowX78/3hN7aEQn5RzT1x7MAYYqYNFLTN1NqmAQPN4RVKg9edrWwSX AVFU04aqbI++SWQprLWr9ugYf/V9+gwG7qnkr2PvpOfBirKsM2x07KvGz9Aorh5R3Wur 8nOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:reply-to:in-reply-to:references:mime-version :dkim-signature; bh=eknW/TOhMypD0xkCLP+fL/Yr6TV2yqEhmiGmkOzq3EY=; b=ojleWIlJ253ZUoImyIvhsVNUDlnL0MWTWK955u1c8cZJL5R5ij954OHDZbtxi8czFv pE0DvOCkwEUVkzl9/lgyiw7XvtDxyDuHtX0fVk2ackHxzTe56EmtRbu3R5aPmxcqUIHo lwCa/XVZ4OKXZY0kRT9LA/B0+WUIV+Tq23thQ0XLn+EUTGdzr5bRCQyjZPA5q+LvGsFb XOOJrzrumpuj7RwtOLfsELDhab44NURcse1Qph+nEJWCl0MtDUYyrOuQh+yzhrPJBiwN HQKmdrmyNZEhAdACbyciVbWbJdTf8MnrJRWZc56MmCDc6qV/G6AIKwtP8otD3xvlT8r4 HEUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SGrHQnGa; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 184si19902408pga.23.2019.07.25.07.00.24; Thu, 25 Jul 2019 07:00:40 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=SGrHQnGa; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388746AbfGYMoM (ORCPT + 99 others); Thu, 25 Jul 2019 08:44:12 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:41688 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387824AbfGYMoM (ORCPT ); Thu, 25 Jul 2019 08:44:12 -0400 Received: by mail-lf1-f65.google.com with SMTP id 62so29561915lfa.8; Thu, 25 Jul 2019 05:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=eknW/TOhMypD0xkCLP+fL/Yr6TV2yqEhmiGmkOzq3EY=; b=SGrHQnGamBfhL9h2LIZhaX7f9KvB10ttFxb277iUL+BvpuX19DWhTckbrOHBS4+bB+ m9YetynEB8y7ypr4B8nFLVAGyapGKxWjoZxUPkuSEeDirKOx+jYujLjma9zqPA4jRlS3 GqwZ7gFTVqcgMYaMp5hSI+XykjFFYKDAt78k+JUDX26g+tebTeWpVj7PKL3tuV7FVjHN JuE8XfOXKZUJ/QTUpnBfsy4KGo+SEGF8wT74VSYK0JXj9TD9qMCge0cJS9XqIsPcrFd7 r8QfBLlVMx5sLRIa7z3M/0UhksbtUTCZ/ao0mZ7+K907kG9CK9zFquLPd5PxSCf8UdbU grbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=eknW/TOhMypD0xkCLP+fL/Yr6TV2yqEhmiGmkOzq3EY=; b=mfTzABfxm8CpRRZbTq1wgaJ85AiA/btb6CDHTVLj03ucLhZVkcRTJ1s8s3/6sgsHU8 0TdKoaxbyEBLAnVH66usqEuCBtvOfXq3EBHYp49w3w/6ac+yROVlr8iwAgW78x6yLM7x qdomT6yrbCfCjndaoC/kdkriaMD3WcCse5NXsR93fF/RGWEoQlL5r7ScqrJ++bW8CTHP JVJTVwkQ00zO+V9ioJHi8Koywc7OJwFWlwWqBUEitQkn+uM7fQDMO6D7wVBB2/pdPu2B gnePJJLy/bmB1t5F5eqVFwPbj+AUekWlt2c672DCJmX3LMnsJ5M3cnMmc0QDixGXLCFC GOTQ== X-Gm-Message-State: APjAAAVsMZmJPDOmCPg6Rhp77vtzy/eIA2GjsiouLt/XgUK6VoxuScod QpMsbKio7TvVtlptZc9KtkHvclMbTuHsWkPwmF8= X-Received: by 2002:a19:7f17:: with SMTP id a23mr44348217lfd.49.1564058649021; Thu, 25 Jul 2019 05:44:09 -0700 (PDT) MIME-Version: 1.0 References: <20190723122016.30279-1-a.swigon@partner.samsung.com> <20190723122016.30279-2-a.swigon@partner.samsung.com> In-Reply-To: <20190723122016.30279-2-a.swigon@partner.samsung.com> Reply-To: cwchoi00@gmail.com From: Chanwoo Choi Date: Thu, 25 Jul 2019 21:43:31 +0900 Message-ID: Subject: Re: [RFC PATCH 01/11] devfreq: exynos-bus: Extract exynos_bus_profile_init() To: =?UTF-8?B?QXJ0dXIgxZp3aWdvxYQ=?= Cc: devicetree , linux-arm-kernel , linux-samsung-soc , linux-kernel , Linux PM list , dri-devel , Krzysztof Kozlowski , Chanwoo Choi , MyungJoo Ham , inki.dae@samsung.com, Seung-Woo Kim , georgi.djakov@linaro.org, Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019=EB=85=84 7=EC=9B=94 24=EC=9D=BC (=EC=88=98) =EC=98=A4=EC=A0=84 8:09, A= rtur =C5=9Awigo=C5=84 =EB=8B=98=EC=9D=B4 =EC= =9E=91=EC=84=B1: > > This patch adds a new static function, exynos_bus_profile_init(), extract= ed > from exynos_bus_probe(). > > Signed-off-by: Artur =C5=9Awigo=C5=84 > --- > drivers/devfreq/exynos-bus.c | 106 ++++++++++++++++++++--------------- > 1 file changed, 60 insertions(+), 46 deletions(-) > > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c > index d9f377912c10..d8f1efaf2d49 100644 > --- a/drivers/devfreq/exynos-bus.c > +++ b/drivers/devfreq/exynos-bus.c > @@ -372,12 +372,69 @@ static int exynos_bus_parse_of(struct device_node *= np, > return ret; > } > > +static int exynos_bus_profile_init(struct exynos_bus *bus, > + struct devfreq_dev_profile *profile) > +{ > + struct device *dev =3D bus->dev; > + struct devfreq_simple_ondemand_data *ondemand_data; > + int ret; > + > + /* Initialize the struct profile and governor data for parent dev= ice */ > + profile->polling_ms =3D 50; > + profile->target =3D exynos_bus_target; > + profile->get_dev_status =3D exynos_bus_get_dev_status; > + profile->exit =3D exynos_bus_exit; > + > + ondemand_data =3D devm_kzalloc(dev, sizeof(*ondemand_data), GFP_K= ERNEL); > + if (!ondemand_data) { > + ret =3D -ENOMEM; > + goto err; > + } > + ondemand_data->upthreshold =3D 40; > + ondemand_data->downdifferential =3D 5; > + > + /* Add devfreq device to monitor and handle the exynos bus */ > + bus->devfreq =3D devm_devfreq_add_device(dev, profile, > + DEVFREQ_GOV_SIMPLE_ONDEMA= ND, > + ondemand_data); > + if (IS_ERR(bus->devfreq)) { > + dev_err(dev, "failed to add devfreq device\n"); > + ret =3D PTR_ERR(bus->devfreq); > + goto err; > + } > + > + /* Register opp_notifier to catch the change of OPP */ > + ret =3D devm_devfreq_register_opp_notifier(dev, bus->devfreq); > + if (ret < 0) { > + dev_err(dev, "failed to register opp notifier\n"); > + goto err; > + } > + > + /* > + * Enable devfreq-event to get raw data which is used to determin= e > + * current bus load. > + */ > + ret =3D exynos_bus_enable_edev(bus); > + if (ret < 0) { > + dev_err(dev, "failed to enable devfreq-event devices\n"); > + goto err; > + } > + > + ret =3D exynos_bus_set_event(bus); > + if (ret < 0) { > + dev_err(dev, "failed to set event to devfreq-event device= s\n"); > + goto err; > + } > + > +err: > + return ret; > +} > + > static int exynos_bus_probe(struct platform_device *pdev) > { > struct device *dev =3D &pdev->dev; > struct device_node *np =3D dev->of_node, *node; > struct devfreq_dev_profile *profile; > - struct devfreq_simple_ondemand_data *ondemand_data; > struct devfreq_passive_data *passive_data; > struct devfreq *parent_devfreq; > struct exynos_bus *bus; > @@ -418,52 +475,9 @@ static int exynos_bus_probe(struct platform_device *= pdev) > if (ret < 0) > goto err; > > - /* Initialize the struct profile and governor data for parent dev= ice */ > - profile->polling_ms =3D 50; > - profile->target =3D exynos_bus_target; > - profile->get_dev_status =3D exynos_bus_get_dev_status; > - profile->exit =3D exynos_bus_exit; > - > - ondemand_data =3D devm_kzalloc(dev, sizeof(*ondemand_data), GFP_K= ERNEL); > - if (!ondemand_data) { > - ret =3D -ENOMEM; > + ret =3D exynos_bus_profile_init(bus, profile); > + if (ret < 0) > goto err; > - } > - ondemand_data->upthreshold =3D 40; > - ondemand_data->downdifferential =3D 5; > - > - /* Add devfreq device to monitor and handle the exynos bus */ > - bus->devfreq =3D devm_devfreq_add_device(dev, profile, > - DEVFREQ_GOV_SIMPLE_ONDEMA= ND, > - ondemand_data); > - if (IS_ERR(bus->devfreq)) { > - dev_err(dev, "failed to add devfreq device\n"); > - ret =3D PTR_ERR(bus->devfreq); > - goto err; > - } > - > - /* Register opp_notifier to catch the change of OPP */ > - ret =3D devm_devfreq_register_opp_notifier(dev, bus->devfreq); > - if (ret < 0) { > - dev_err(dev, "failed to register opp notifier\n"); > - goto err; > - } > - > - /* > - * Enable devfreq-event to get raw data which is used to determin= e > - * current bus load. > - */ > - ret =3D exynos_bus_enable_edev(bus); > - if (ret < 0) { > - dev_err(dev, "failed to enable devfreq-event devices\n"); > - goto err; > - } > - > - ret =3D exynos_bus_set_event(bus); > - if (ret < 0) { > - dev_err(dev, "failed to set event to devfreq-event device= s\n"); > - goto err; > - } > > goto out; > passive: > -- > 2.17.1 > NACK. It has not any benefit and I don't understand reason why it is necessary. I don't agree. Please drop it. --=20 Best Regards, Chanwoo Choi