Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3563053pxt; Tue, 10 Aug 2021 06:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcc26nHskqhiyOmJ26cqynI5tURjnNORuUtT3n2IGPyUhvywYT7+xZoUYoKIgRbVOEWE8/ X-Received: by 2002:a17:906:40d1:: with SMTP id a17mr28043693ejk.503.1628602189695; Tue, 10 Aug 2021 06:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628602189; cv=none; d=google.com; s=arc-20160816; b=pGzn2isPIE+soO/OAPANHA3TTTIJu30gtrGyGEz6bnRrFh4tvR5RHO3CSwy48DHxNi yZrasBgah8Z70imi9OICquZ0X+6FDDRuvE9xM2PzPOXNU6htg2JpgjQqsQFcDpFgLfg0 2OwW2qxoZThZIuPiYMvz+iR1eV9q8GL+bIyRwPeiVbrnCZEIS6ob7rYBQK5feZi8ITvP 2IboIEBw9vY9Ss13seeaL4IQs1fOSXEHYn/kFWX1le094WjqiYlui3U2dD8q5Q0mqFf2 RqDkxFp96VRXnGPumH28FUHEi9hRqJPDNu7c4CAvgat8D9sLAPHA8EMV9S1aGTFTSB5x paCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=gnLG52ZdGhdA1dXfJGWT61NfUsyzbdeIGKqaSMA/y9M=; b=oCmPc8WHDj411SApnYt98FlKmgR77dD+61vW9ICSesyY/I0XfBrUoUKkap7DCx4j8W iG6Bwm8KmKSwpykyBgJOISAzbSBs7CrQ+H4VW6p3ossnunQLi62MJfPIpaT/rhVEgSTb IZ8zuMIEVa20OLTXg8pGenOJ0E9fjv6HdnKHYv8QL5JtIMRIRm+GA39H1L1e41R0ZwYD qfR0TIwnUWOAlw7aCwA9ojQLJb8VK+XpBM4YJKxWk0SfxdbbAG2hwDxRtQzZAyBQz30l iPkosKwzBP3NaT/fGLCPNDEL5+iGstuEaHcFC68hRKMZ4ztPPgmVJLdnX7dacGnFrevr qpHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si20204243eda.177.2021.08.10.06.29.20; Tue, 10 Aug 2021 06:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238870AbhHJKTx (ORCPT + 99 others); Tue, 10 Aug 2021 06:19:53 -0400 Received: from foss.arm.com ([217.140.110.172]:52976 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238598AbhHJKTw (ORCPT ); Tue, 10 Aug 2021 06:19:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CE6C36D; Tue, 10 Aug 2021 03:19:29 -0700 (PDT) Received: from [10.57.9.181] (unknown [10.57.9.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D5E63F70D; Tue, 10 Aug 2021 03:19:28 -0700 (PDT) Subject: Re: [PATCH 2/8] cpufreq: dt: Use auto-registration for energy model To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org References: From: Lukasz Luba Message-ID: Date: Tue, 10 Aug 2021 11:19:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/10/21 8:36 AM, Viresh Kumar wrote: > Use the CPUFREQ_REGISTER_WITH_EM flag to allow cpufreq core to > automatically register with the energy model. > > This allows removal of boiler plate code from the driver and fixes the > unregistration part as well. > > Signed-off-by: Viresh Kumar > --- > drivers/cpufreq/cpufreq-dt.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > index ece52863ba62..b727006e85af 100644 > --- a/drivers/cpufreq/cpufreq-dt.c > +++ b/drivers/cpufreq/cpufreq-dt.c > @@ -143,8 +143,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) > cpufreq_dt_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs; > } > > - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); > - > return 0; > > out_clk_put: > @@ -176,7 +174,8 @@ static int cpufreq_exit(struct cpufreq_policy *policy) > > static struct cpufreq_driver dt_cpufreq_driver = { > .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | > - CPUFREQ_IS_COOLING_DEV, > + CPUFREQ_IS_COOLING_DEV | > + CPUFREQ_REGISTER_WITH_EM, > .verify = cpufreq_generic_frequency_table_verify, > .target_index = set_target, > .get = cpufreq_generic_get, > Reviewed-by: Lukasz Luba