From patchwork Fri Jan 2 07:04:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 42689 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A24A26CD1 for ; Fri, 2 Jan 2015 07:06:07 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf10362339lab.7 for ; Thu, 01 Jan 2015 23:06:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=UMbpwXtj98UozxBt1mHGI4LtIGxKjaqAn2ZZ2ngLXSo=; b=ZARsDANqjPUNrGFzTO1p9RST8d9M3opGCNo4q6y8xdtGpsTzVNxYAM6BEE/bVbYbNe tE7t0zFa686WMWX906zO8Z6t5pyb726BuqRL0S+tUkguczd/02u2CGthezYcSAczhEnL RIjb+xP4kSG3EHG7zWi+zhWmqZ8woG8vHJq/KbX5yZQiogiO/pHMsTJOGXx2aOWt0RKq LFEzBQvLKBdRURLPpwNRQdIcw5e5npm7FIT2+/4Y0+6QoMShcsniwEWzviQ7Tn4jeloj D4rZUqPuuyzPB2iGvTFtFRV+Tu447aX+kzAx78CqZWAXkQfkNzfBY1fNgkhHH1u8K258 YOxQ== X-Gm-Message-State: ALoCoQkClF7S6hSa2lC3xAF/Ou5Bj/hPqHjU57X4r5jDn+54DvwfucHziiVBOxviSzz9Kcz39OWL X-Received: by 10.112.171.74 with SMTP id as10mr92000lbc.8.1420182366124; Thu, 01 Jan 2015 23:06:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.104 with SMTP id kx8ls2339199lac.82.gmail; Thu, 01 Jan 2015 23:06:06 -0800 (PST) X-Received: by 10.112.167.136 with SMTP id zo8mr50080937lbb.17.1420182365976; Thu, 01 Jan 2015 23:06:05 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id vy5si9579049lbb.18.2015.01.01.23.06.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:06:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so14672366lbi.38 for ; Thu, 01 Jan 2015 23:06:05 -0800 (PST) X-Received: by 10.112.131.1 with SMTP id oi1mr73218958lbb.2.1420182365881; Thu, 01 Jan 2015 23:06:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp126262lbb; Thu, 1 Jan 2015 23:06:04 -0800 (PST) X-Received: by 10.66.181.136 with SMTP id dw8mr122284886pac.117.1420182362462; Thu, 01 Jan 2015 23:06:02 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dl1si29047854pbb.67.2015.01.01.23.06.01; Thu, 01 Jan 2015 23:06:02 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750770AbbABHGA (ORCPT + 12 others); Fri, 2 Jan 2015 02:06:00 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:44531 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbbABHGA (ORCPT ); Fri, 2 Jan 2015 02:06:00 -0500 Received: by mail-pa0-f43.google.com with SMTP id kx10so23711949pab.2 for ; Thu, 01 Jan 2015 23:05:59 -0800 (PST) X-Received: by 10.66.65.195 with SMTP id z3mr5730577pas.104.1420182359765; Thu, 01 Jan 2015 23:05:59 -0800 (PST) Received: from localhost ([122.167.116.151]) by mx.google.com with ESMTPSA id de7sm45575446pdb.74.2015.01.01.23.05.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:59 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH 17/17] cpufreq: move some initialization stuff to cpufreq_policy_alloc() Date: Fri, 2 Jan 2015 12:34:38 +0530 Message-Id: X-Mailer: git-send-email 2.2.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We need to initialize completion and work only on policy allocation and not really on the policy restore side and so we better move this piece of code to cpufreq_policy_alloc(). Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 62c6a0b8b0d1..ace5dd4cd271 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1019,6 +1019,8 @@ static struct cpufreq_policy *cpufreq_policy_alloc(void) init_rwsem(&policy->rwsem); spin_lock_init(&policy->transition_lock); init_waitqueue_head(&policy->transition_wait); + init_completion(&policy->kobj_unregister); + INIT_WORK(&policy->update, handle_update); return policy; @@ -1142,9 +1144,6 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) cpumask_copy(policy->cpus, cpumask_of(cpu)); - init_completion(&policy->kobj_unregister); - INIT_WORK(&policy->update, handle_update); - /* call driver. From then on the cpufreq must be able * to accept all calls to ->verify and ->setpolicy for this CPU */