Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3392096pxt; Tue, 10 Aug 2021 02:30:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGKT2pTQ8KH72u7Mx0rasjk/9FUvyEPyJL1YggNE3v59LPh6s2RJUTKOivsGBkLHyixAOj X-Received: by 2002:a05:6402:4cf:: with SMTP id n15mr3832532edw.269.1628587823410; Tue, 10 Aug 2021 02:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628587823; cv=none; d=google.com; s=arc-20160816; b=kWfrUgbwkBhD46xpD76Zl99J1/iSOvGUV5lvBhXzqDGVFE2MuUe5ists/F3vc5XdOs s5rl87+JSCvwZyTqEN4TOft+ljHqEw3A5lCwNS1JHjTOhFFFYjApj+5rn8TWX9y1MesW SJG8KKn3P5nsAa2NG5+40anee1ycFEXzkQvVtEpvNwc9F9zIOeMnf6hJ6VRbtb5nSmKq 6B3Z15ZY5vc20WbSoWy7TrHyvMgzw6RNUjcxvlCvN2e/TLxVdghynJQAyaoVkNF5mUB1 ao+4UjIMyL/U3gArh5YucjuYnzp5XryAnV2U6gAloAc4u6LDcdzsxvkawbaBKE5kZyTH Gxtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=Zseaenkr/gcsQt4qJi7Wh8HOYXPidn+MEtdquRPLioqkqVR7+C4sdwzHDmE//e9GJz 5ki2p/EDDNP0HF1+LrkvHfiLepWTQrunl6/Zir8/7fOUcWYfVPBJbv/jCqLDMf1p/+yG cvaK4TLTKuyd4KVodUH3r9QatCn+XctuOwVKYTuT4dVkoF16UdRaP6PpB8J3ECf4a27i JnPAcQRd/5T0PIc5gHnGVS6AyM8Cat4I34XFYP2y9RfaZ5NFVLTXEjJmuHb5affnOrDp pQD7Otw4pnnOtJAwWr2QjuUGDtZoS0xthlIO1O3K8gKIQYmcP1sb6jrxT4l15BNSXIgs 0C8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tDJZDgwt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si19981850ejj.302.2021.08.10.02.29.56; Tue, 10 Aug 2021 02:30:23 -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; dkim=pass header.i=@linaro.org header.s=google header.b=tDJZDgwt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235421AbhHJHhk (ORCPT + 99 others); Tue, 10 Aug 2021 03:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235235AbhHJHhj (ORCPT ); Tue, 10 Aug 2021 03:37:39 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9822C061798 for ; Tue, 10 Aug 2021 00:37:17 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id lw7-20020a17090b1807b029017881cc80b7so3076544pjb.3 for ; Tue, 10 Aug 2021 00:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=tDJZDgwt6Zksre0+Hb84Oaba+GoGOFFnBNTSeFFbIxWMY/kmyer6CIsG5m8Gy1g4kk ZPUAYeVRYBtzn0FBsxM4HhlemFAWLIb56qQo4pQnz6c5f7xENOK6is2MpgB5M1+OBV+S 9Zm/29cSjLdXxi+vsEPSUIH6KgUXgXJsq0AylkYvvSZhObcjRBgiojCe/7Sj210pOp80 B+rZ+ivfcTLYlFni4Hj2lO6nKUPI0+ITlM7b3vSLzNp2txKbP/hwxM67bbsz45XYtwBD 0fFIr55WXt/JEs1cPOIdCNfXMztD8eqHJaqaBeHvwiddMhcl6kMq2iyk2VxenpTkoJfB SiDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=ZeQj2apcnI/KVrFGe+DHBWYdMRiJ18nFwDOnbldr6a8xL8/eHp9qtiw8RNubFAqTN4 W94Rvz3itE/EotkppEPepONqUmMyLCOEP2CVa7DukTI8NC48GAl39+ten6BK17sMt6ve h2friN5d3A6/HO76YNq1UkLMowixGzJqsG/r2qkrv9EM0fhK0RfwuCz/yB9RKKX4w5fQ jO6P/eXU60UkwOY9uWOhJ4uwV8w87N63lHJG+d0fvqjhcZBpvHW51P068DesiLqn8pWU FMFOywm43nw32/JDKmM/1Eu23ZbOqmgnQKqi1SLX0Ox8doEnSKJ5sSF49/7415EtS+vK fWYQ== X-Gm-Message-State: AOAM531O/eLfSzg7Q9aH1+e1rPwEH03+IvOYTJ5IgHkMG1sAgxq0SSu1 PALRVxqMsi+enPBfFlyaw/pnVA== X-Received: by 2002:a65:5c48:: with SMTP id v8mr8527pgr.411.1628581037290; Tue, 10 Aug 2021 00:37:17 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id d9sm21546884pfv.161.2021.08.10.00.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:16 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] cpufreq: imx6q: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:50 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/imx6q-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 5bf5fc759881..aa8df5b468d7 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -192,14 +192,14 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) policy->clk = clks[ARM].clk; cpufreq_generic_init(policy, freq_table, transition_latency); policy->suspend_freq = max_freq; - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); return 0; } static struct cpufreq_driver imx6q_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 = imx6q_set_target, .get = cpufreq_generic_get, -- 2.31.1.272.g89b43f80a514