From patchwork Mon Jan 28 06:41:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10783323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94C61746 for ; Mon, 28 Jan 2019 06:45:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 831E62A395 for ; Mon, 28 Jan 2019 06:45:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B4B2A3A1; Mon, 28 Jan 2019 06:45:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15BDB2A39C for ; Mon, 28 Jan 2019 06:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbfA1Gpv (ORCPT ); Mon, 28 Jan 2019 01:45:51 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52800 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfA1Gpu (ORCPT ); Mon, 28 Jan 2019 01:45:50 -0500 Received: by mail-wm1-f68.google.com with SMTP id m1so12687846wml.2 for ; Sun, 27 Jan 2019 22:45:49 -0800 (PST) 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 :in-reply-to:references; bh=T0qbmuuRPxDVtPya/S7z9HnIzaHUQLSLFndkXz9dAlg=; b=DW4K/5zlEo6p1xfdiXC+ynAc8dp2Dfyn0kNB0kyOtEt+Uk9Fl/LFxWlhD5JVjyaY/x V78KHr0qkFAKLjVIzFRlNNeDM7u5RrqTzPeOxlIH0wioS0vBNt1nBMoJZy2ERknd5h+w O38eisMJ4t7VOtaxL09vlB/KIgOCGPLDer9aQ= 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:in-reply-to:references; bh=T0qbmuuRPxDVtPya/S7z9HnIzaHUQLSLFndkXz9dAlg=; b=Nh+LYlX+qeZg1Y/8Kx01f+hsTzbRowFqqcCyZoRM7gqApfvX7Cm13z4uBw5mAu1ar+ tHi4v3DfQ1i+GzwDyz80vTvbfP2r8In8Wl6Scp4pXtJsDkNdOSf9OHx8zQPW6WxqxeWg unbS0+hM0PzBSQZTFH47fMnS+4yWwHjDU2gTNAqrB9TaZPfHZ2jEdGxzXUnS0oyeo8fJ oCiHNIOL0sth2utDF4DYYVdz9KdGPyz2NkaWodRgZkhYCLsACTzU8KH9Z15b8Hreo5/b EB+seCbXKT4rwlvYcjohK5pxHCUG0s9b7DwydZHMITcgsQ8tV9l/LAk/+XhyOm5FJa/m VIHA== X-Gm-Message-State: AJcUukcX9mOrF02EhzVi55SiunOxtvUzEHfHRMbxrkzB3Q2owqxdPbxj HgiVMzlJy7GU4po9cb+Y2gj7eA== X-Google-Smtp-Source: ALg8bN7PuY29IrzZlJCKeMKfosA84RU1hevR1plRqWI35EXyy7zG9AdByO9Mr59OwoBMlA+tje7Tlg== X-Received: by 2002:a7b:cf30:: with SMTP id m16mr262294wmg.22.1548657948489; Sun, 27 Jan 2019 22:45:48 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id w10sm7927176wmb.1.2019.01.27.22.45.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:45:47 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, viresh.kumar@linaro.org, edubezval@gmail.com, swboyd@chromium.org, dianders@chromium.org, mka@chromium.org, "Rafael J. Wysocki" , Markus Elfring , linux-pm@vger.kernel.org Subject: [PATCH v4 7/9] cpufreq: qoriq: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:32 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the CPUFREQ_AUTO_REGISTER_COOLING_DEV flag to allow cpufreq core to automatically register as a thermal cooling device. This allows removal of boiler plate code from the driver. Signed-off-by: Amit Kucheria Reviewed-by: Daniel Lezcano --- drivers/cpufreq/qoriq-cpufreq.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index 3d773f64b4df..b206e6cb55f0 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -31,7 +30,6 @@ struct cpu_data { struct clk **pclk; struct cpufreq_frequency_table *table; - struct thermal_cooling_device *cdev; }; /* @@ -239,7 +237,6 @@ static int qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy) { struct cpu_data *data = policy->driver_data; - cpufreq_cooling_unregister(data->cdev); kfree(data->pclk); kfree(data->table); kfree(data); @@ -258,23 +255,15 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy, return clk_set_parent(policy->clk, parent); } - -static void qoriq_cpufreq_ready(struct cpufreq_policy *policy) -{ - struct cpu_data *cpud = policy->driver_data; - - cpud->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver qoriq_cpufreq_driver = { .name = "qoriq_cpufreq", - .flags = CPUFREQ_CONST_LOOPS, + .flags = CPUFREQ_CONST_LOOPS | + CPUFREQ_AUTO_REGISTER_COOLING_DEV, .init = qoriq_cpufreq_cpu_init, .exit = qoriq_cpufreq_cpu_exit, .verify = cpufreq_generic_frequency_table_verify, .target_index = qoriq_cpufreq_target, .get = cpufreq_generic_get, - .ready = qoriq_cpufreq_ready, .attr = cpufreq_generic_attr, };