Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3365299pxt; Tue, 10 Aug 2021 01:43:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDDcpa6WeoWSAUvPAZQmz9aQMPQKffntNBv9ifwvixPhfZzhLqmE7tDROCmndAMDYdxS2l X-Received: by 2002:a05:6402:22b0:: with SMTP id cx16mr3597331edb.185.1628584983093; Tue, 10 Aug 2021 01:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628584983; cv=none; d=google.com; s=arc-20160816; b=TUALjy5e1geyI9QusW6gXjnni2JF/9XSr886BiFviL8cIU8h7O/GoxkBHjkJ7aRElD 0qpBOKkmGivX2eT3A+pdThNnZL6yxh+KtdrEBbuCyfYhGFEEoSZ8KdhwmcVXQMXcy13e NGKj8O9c9YIYXvO6Jzru4FMKmEpXVZELhnjZUlkCDXb8vVWE6PLP0LjhkbWWjWXaTT0K 8s9H9F8YPGEoS3aIzAlp4qe19VQs90aP1JKcnzxPRuweJWfRiu3vsx3XFSWvW6GcyTWT oCs/MbpNp+ZPs7nJAGqsVl9JcIUDvMVg8YqdRjPI+AdCVXxcPLKLrypR7d8vjOKErzsZ JeFQ== 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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=vR/OOl3SU8hPpsifowp1P65COjC81HqznryYd3pTJ4eHSTEh4OUNxxKEzbUn3BbTbu zXygdpm44RtzV2JexhvJ0GiT/TyF/zqt2R2VNMMMtViIdWc7wK/q/AfRRcpCkpyWRdv5 BtjxLLJiFCDZqKtFsKleTqwGpftOW0ftPnv4CH7rVF6kgAXV+gkSkxLiRYaNXncgDcv+ f4tXK+QtulW58rm9ELK4PoQdgIsy11E2BHiwZQYlFQdoTIABHKOK/PFyO9W/EDIfuMep WLJ2Oa83dUxMLmL4Uu8jfWFKJU+7Rrpk+p40PDiFkyF8GJu77gVWUssNUbIcy/2AgHJm hglA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kn615fl5; 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 h18si4443200edq.56.2021.08.10.01.42.37; Tue, 10 Aug 2021 01:43:03 -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=Kn615fl5; 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 S234958AbhHJHhi (ORCPT + 99 others); Tue, 10 Aug 2021 03:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235234AbhHJHhh (ORCPT ); Tue, 10 Aug 2021 03:37:37 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3301C0613D3 for ; Tue, 10 Aug 2021 00:37:14 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id 28-20020a17090a031cb0290178dcd8a4d1so1260906pje.0 for ; Tue, 10 Aug 2021 00:37:14 -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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=Kn615fl51FeOD52lrtpgeS7SnpliWdUH/DpbmWYGWHk30G/nLAaMrllwgIn5weKJJC e5Jhdl9JeKyqspRiJ1kyUWv0qr/RxWMdiFtZnq269arO0CiT7hLub8mqmgBolBUvGgbN UVVVrZuv7+NYF5577lZCH+2wcgxlgAatlSl9AJeJW79wwirigzP/D3w5NLswTE+GCSGk DxPhctc5QEbB64l6CsM+7WK82AJK+8f7d2W+Q7OtzOgVemxGd+ejqT33WeJ9pzP4G7z2 455pT63z/E0vj2VhGPMIBs9bR6GhK+90AqBXrhy67N6mk0KmD8QeAMGKmAlJcxatlxfc 8txw== 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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=Q4MwFSBczj9nSFrsbbd1tLlXa/GYAMSUKr6weXq+8NvfOei6MvdDEKTeuqjUGjfMKv 7iuT3iTeRy6MZ9heKoYNFsx4T9lpunPfB/ZEWKn9cYuedbr8NYPBb3vyivH/BR9L6XT3 mNiVxjeS3RAAv37cvMBlWcuQGaMkLtNGkmA/NCs/viJHcp/j+boJtWxpt9szXQWvFHcD E1EURlfKgI5/L9Z1WHAVAieoI2yGxkJuyN7nO5/bTQSZ2EwQUcDvLoyVrOoJYWSVze23 0PBTLl9tARawYI/+qUaZiuFztUK3swNPiPbKX1Q7klvvk2eQIX3HssctGXnvgx3QbfV7 b/jw== X-Gm-Message-State: AOAM533amlu8598X0qO8YBOEEs+qouqCXgoyhu8zNLEUUtyIGjjizn5P YyUOB4ojgsvb46SVDDBF5scS4g== X-Received: by 2002:aa7:8d94:0:b029:3a0:a513:e13a with SMTP id i20-20020aa78d940000b02903a0a513e13amr21899757pfr.56.1628581034296; Tue, 10 Aug 2021 00:37:14 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id hd21sm1912831pjb.7.2021.08.10.00.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:13 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH 2/8] cpufreq: dt: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:49 +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/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, -- 2.31.1.272.g89b43f80a514