Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3767246imu; Mon, 14 Jan 2019 08:41:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4B7NOwhSTPDuzl4K0mtwE9S3Vbmx/Q45TLJ7ZeIJqdr27froGSx4vXHLly+gY+n30Upi3G X-Received: by 2002:a62:798f:: with SMTP id u137mr26424414pfc.168.1547484062579; Mon, 14 Jan 2019 08:41:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484062; cv=none; d=google.com; s=arc-20160816; b=o5EMLnqDxu6s1Pk5egzarPEZ7Zx6DmfyQ6HJFW9qBAZClOmOscJro+Qj92SXM0ZEAx OBn5pHf9XQkW/JywQrNGP6qTWVOA1s3U8GTiyNhi9POq1g7CEp/G5wga+N8zT5ikng3d C/RDXzJz+CNK7BiIE57MRo0GGiIZeCEQnXYUYaR3TUEBNWuYZFAVah2ddjW7ogL1Mu3N BA9F7ghioEUVoKLXmR9jnkIS4mdAAYHm1jdduewD5VuCcEATaA0eQJJ5aLX+NYCg/YMJ ylvwj5YSqmb8QkQesegvlHi0dqQfF7l5zxsTyGgb0ihyfG8QJ5w1CjJalSZjRtn+iUoT lUMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=UIVW5Jk3h063m2TjLZyvAJQQxY5HQB8LVsVnZkvA3R0=; b=Hv0umnmt4C5UoGS80zjfCerlVuIrva27wPTjX2oH21OuB2f7MaSYMoMzY2+1//Xbiy 52Ck4SZXKmJxgpuwzgAcjzTxUB4bfC0tatfMuQcoJDt7A4q89bMmjXRaO8wa6/scczDw WTl7Di0uXRhNCYZlwYflNqQq5JcjS7g9KuajF6Qqg4hZh4CnTCRNwT4k1FWRLrCJhTgo nn5ckFdm05TXbe2hH+2t7W7BfkPcKsnFQFevqPnlwKBxNUpQyEsH1udTLfDB7QHMS3hh MQewOBxFiszgDBV+eB/Y1Kce+P4Tkr2SGFclr6IkfzHd75g/78sugwmv85QmWqZrLNIl hnaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oe5N8JYA; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si716341pgd.437.2019.01.14.08.40.47; Mon, 14 Jan 2019 08:41:02 -0800 (PST) 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=@linaro.org header.s=google header.b=Oe5N8JYA; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbfANQiw (ORCPT + 99 others); Mon, 14 Jan 2019 11:38:52 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43486 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbfANQiv (ORCPT ); Mon, 14 Jan 2019 11:38:51 -0500 Received: by mail-wr1-f68.google.com with SMTP id r10so23641718wrs.10 for ; Mon, 14 Jan 2019 08:38: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=UIVW5Jk3h063m2TjLZyvAJQQxY5HQB8LVsVnZkvA3R0=; b=Oe5N8JYAdaTMIzIXzxENuBPAAkXsaAkTXY1hQM2DXCEDtSRB8YPdZc1Z6ShWxktov2 ZR5kbfQP/Z5P2bFF+aECvR2FeAwTLxJfYGTN/b23rj/w3DzC6/CfVhH0RYRf86/RHvla 9LLdaJmiWToZ9s6mCd3GqK4FUZa4FppMCTyPQ= 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=UIVW5Jk3h063m2TjLZyvAJQQxY5HQB8LVsVnZkvA3R0=; b=mFUjFK8Ryx9czmDxE0hyIoXz82TkinqrEZcBy83GfmE4X5V3bBtMy6ODLvYyEI3DIq 7Zl9Ast0GHrdBwB1TWgUZT6Ye6hBne93QJD49OPDBbACFfgDq1fmjzINxljxXZpG9UPK yBeG/JoXH/HjshGzLwfyDWN/skpxSpwplZvtleHS8oQyonvhQstivYnWg+pt5b45sDo9 hMhSsErGR6/fQbXrMYuXPEZU4gC4GhXGnqwWLxMFEgAxV90HlpY4g3T5ePFAMbezr1FD ZFK990TSMGae1UMLblzzjlYnLSPAZrfPfYNwHrDcoiO/HrHmz7og9KgbjooIacU22wS9 axAQ== X-Gm-Message-State: AJcUukebIrdGuN+gRnFISeAlKnMmJly12NZrpUOHmKrN6SoPoWU2MXpy fMeW+HUMbeyEQp6o4lfFzLvmDkoZpTanfw== X-Received: by 2002:adf:cc91:: with SMTP id p17mr25446735wrj.118.1547483928892; Mon, 14 Jan 2019 08:38:48 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id e9sm60948525wro.16.2019.01.14.08.38.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:38:48 -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" , Anson Huang , linux-pm@vger.kernel.org Subject: [PATCH v1 05/10] cpufreq: imx6q: Use auto-registration of thermal cooling device Date: Mon, 14 Jan 2019 22:04:57 +0530 Message-Id: <49e531e140f299127ae6c0bc905b993b97c269e2.1547481320.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/cpufreq/imx6q-cpufreq.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 9fedf627e000..ffb00291f48e 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -52,7 +51,6 @@ static struct clk_bulk_data clks[] = { }; static struct device *cpu_dev; -static struct thermal_cooling_device *cdev; static bool free_opp; static struct cpufreq_frequency_table *freq_table; static unsigned int max_freq; @@ -193,16 +191,6 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) return 0; } -static void imx6q_cpufreq_ready(struct cpufreq_policy *policy) -{ - cdev = of_cpufreq_cooling_register(policy); - - if (!cdev) - dev_err(cpu_dev, - "running cpufreq without cooling device: %ld\n", - PTR_ERR(cdev)); -} - static int imx6q_cpufreq_init(struct cpufreq_policy *policy) { int ret; @@ -216,20 +204,18 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) static int imx6q_cpufreq_exit(struct cpufreq_policy *policy) { - cpufreq_cooling_unregister(cdev); - return 0; } static struct cpufreq_driver imx6q_cpufreq_driver = { - .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK, + .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_AUTO_REGISTER_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, .target_index = imx6q_set_target, .get = cpufreq_generic_get, .init = imx6q_cpufreq_init, .exit = imx6q_cpufreq_exit, .name = "imx6q-cpufreq", - .ready = imx6q_cpufreq_ready, .attr = cpufreq_generic_attr, .suspend = cpufreq_generic_suspend, }; -- 2.17.1