From patchwork Thu Sep 12 05:25:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19986 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF3AB20F59 for ; Thu, 12 Sep 2013 05:27:09 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r3sf10820251yen.11 for ; Wed, 11 Sep 2013 22:27:09 -0700 (PDT) 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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=g+mif3a02xxb8b8hkQdFmhaLmNDAsyt5cuVqzPPJvmQ=; b=MedLrzqXMonhdZ/4iCJbWf3ZlmV3Ye/wJYW0fe02KdlzYjvhglbkLk5pLtQxGiaSj3 /4psDa9KV/H3ASXzdiNDJ1/bKFfxWc2YpUiFjrpMiLWg0iePDHvFDh9qaH66UH59Egkm rIewzW+nWsWzjla5j5Au6iOHB2htwIeUueVtNiz34i57wCF8RTpK1UpaMaXgnI7uTSHK GrcdxKBwa5tC/kKDqXEmX7p0SvVHYDqT5F4ovqbdMtjPGzJ2aRkrNkPqSwLG5UnVwdvA UQep14GZwMe7/NxneljYPG4GK9LEaBD+OAKaMVgMV8yk2TM+chMrFnJo6x/ISCFqmu3I Gm5w== X-Gm-Message-State: ALoCoQndCQt6aEZWozqUf9Cv9Y4jDfTvoc7OvfSS9+LjmOzOo27oitVplEhJ4jA4wrqZTA2tL3X6 X-Received: by 10.236.6.134 with SMTP id 6mr2234272yhn.7.1378963629462; Wed, 11 Sep 2013 22:27:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.76.100 with SMTP id j4ls548847qew.29.gmail; Wed, 11 Sep 2013 22:27:09 -0700 (PDT) X-Received: by 10.58.118.130 with SMTP id km2mr4865211veb.0.1378963629233; Wed, 11 Sep 2013 22:27:09 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id ti4si644990vec.99.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 22:27:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so7046187vcb.11 for ; Wed, 11 Sep 2013 22:27:09 -0700 (PDT) X-Received: by 10.52.114.231 with SMTP id jj7mr4171460vdb.2.1378963629147; Wed, 11 Sep 2013 22:27:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp866vcz; Wed, 11 Sep 2013 22:27:08 -0700 (PDT) X-Received: by 10.66.218.98 with SMTP id pf2mr7651854pac.120.1378963628325; Wed, 11 Sep 2013 22:27:08 -0700 (PDT) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id yk3si5182016pac.157.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 22:27:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id rq2so10034629pbb.5 for ; Wed, 11 Sep 2013 22:27:08 -0700 (PDT) X-Received: by 10.66.142.42 with SMTP id rt10mr7478367pab.1.1378963627950; Wed, 11 Sep 2013 22:27:07 -0700 (PDT) Received: from localhost ([106.197.36.204]) by mx.google.com with ESMTPSA id im2sm2132469pbd.31.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Sep 2013 22:27:07 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl, swarren@wwwdotorg.org, srivatsa.bhat@linux.vnet.ibm.com Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 3/5] cpufreq: remove __cpufreq_remove_dev() Date: Thu, 12 Sep 2013 10:55:46 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Nobody except cpufreq_remove_dev() is calling __cpufreq_remove_dev() and so we don't need separate routines here. Lets merge code from __cpufreq_remove_dev() to cpufreq_remove_dev() and get rid of __cpufreq_remove_dev(). Signed-off-by: Viresh Kumar Reviewed-by: Srivatsa S. Bhat --- drivers/cpufreq/cpufreq.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 31f7845..5e0a82e 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1285,36 +1285,26 @@ static int __cpufreq_remove_dev_finish(struct device *dev, } /** - * __cpufreq_remove_dev - remove a CPU device + * cpufreq_remove_dev - remove a CPU device * * Removes the cpufreq interface for a CPU device. * Caller should already have policy_rwsem in write mode for this CPU. * This routine frees the rwsem before returning. */ -static inline int __cpufreq_remove_dev(struct device *dev, - struct subsys_interface *sif, - bool frozen) -{ - int ret; - - ret = __cpufreq_remove_dev_prepare(dev, sif, frozen); - - if (!ret) - ret = __cpufreq_remove_dev_finish(dev, sif, frozen); - - return ret; -} - static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) { unsigned int cpu = dev->id; - int retval; + int ret; if (cpu_is_offline(cpu)) return 0; - retval = __cpufreq_remove_dev(dev, sif, false); - return retval; + ret = __cpufreq_remove_dev_prepare(dev, sif, false); + + if (!ret) + ret = __cpufreq_remove_dev_finish(dev, sif, false); + + return ret; } static void handle_update(struct work_struct *work)