From patchwork Wed Oct 2 08:43:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2973581 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2124F9F527 for ; Wed, 2 Oct 2013 08:44:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78D1A203DB for ; Wed, 2 Oct 2013 08:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F972203D9 for ; Wed, 2 Oct 2013 08:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753623Ab3JBIoW (ORCPT ); Wed, 2 Oct 2013 04:44:22 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:59860 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753611Ab3JBIoW (ORCPT ); Wed, 2 Oct 2013 04:44:22 -0400 Received: by mail-pa0-f48.google.com with SMTP id bj1so735682pad.21 for ; Wed, 02 Oct 2013 01:44:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ovPCoDOKAi04x7NcGedRGeU4Xpm2HQcpsjarzoMxHbU=; b=HYr0LRKf+pvsxnWMlPEudsN1eVdFYi1sxFB04M4a4UwkGi7VRSXBwKbkQaW0fqaN9z 4wMPkoj7Efm1xnkXprFYfxylE6fQl+h3LQpt9A0ZvOqMbo7Hix6cWtbwjZhn/bjQB8MQ f7U7lJCHSrmHX7acciBWGkR/znr0NCyxlMnNYxaqY2nRJNiIthqQD5bNRKyEdiNGK4G0 OUd/UWMS1APho/XqBPd7bHGgGB4pOI0runpbaB69vNpzfrw35wgbgkjjuV9fWN/2cRg/ 5/MsXw0NzmKvMj0uq27uip1a5uahv/DVEA9FdktO9Me26P75OTDtudklYLHgJ98+8PZb 92JA== X-Gm-Message-State: ALoCoQn+RTfrYB+XTGOraTkOKLVzaGWzmqe/CTvVIs9yLb2ltxQ5dcB++PxkTI2tXabiLhUTW2DL X-Received: by 10.68.113.130 with SMTP id iy2mr1348498pbb.2.1380703461403; Wed, 02 Oct 2013 01:44:21 -0700 (PDT) Received: from localhost ([122.167.152.64]) by mx.google.com with ESMTPSA id lm2sm2058686pab.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Oct 2013 01:44:20 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, Viresh Kumar Subject: [PATCH RESEND 06/11] cpufreq: remove __cpufreq_remove_dev() Date: Wed, 2 Oct 2013 14:13:14 +0530 Message-Id: <6a2e0a9a7a84827cce389cc893b4f5521930df8d.1380703248.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(). Reviewed-by: Srivatsa S. Bhat Signed-off-by: Viresh Kumar --- 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 065b4dd..1394dac 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1256,34 +1256,24 @@ 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. */ -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)