From patchwork Thu Jan 1 17:06:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5557341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EC263BF6C3 for ; Thu, 1 Jan 2015 17:06:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC1852022D for ; Thu, 1 Jan 2015 17:06:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF5F32021B for ; Thu, 1 Jan 2015 17:06:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y6jAF-0007xR-6e; Thu, 01 Jan 2015 17:03:59 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y6jAB-0007uK-R0 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jan 2015 17:03:56 +0000 Received: by mail-wg0-f49.google.com with SMTP id n12so23304836wgh.36 for ; Thu, 01 Jan 2015 09:03:33 -0800 (PST) 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; bh=un3C6rkQLGdEAjiUboIS4pwvnlYQbpAjIYbNXgtjnv4=; b=GK+oH/Xm07NSzRiTUti5CoqhyWFZSYw+Tj/io55qCLAuIpWhdqp56ZO6mmphs74ypL N5fB4HvwQVVn1WbnSQuqX41mqhMHFzHWaoIxVMIolXhrMzuPHm1TPmM+/Wqoenb6F9K3 shgECk7yP58Y4pup+9JAJ/3jBHPLUz573baZJAU2l2BxmkBkHqXF2dtiwnjaFQCHjCec MaZnbDIvN88/7cvYTYBUxI5xbZIwyd5LZ7gG11yC3mz7DYRD16P43vtZEyR8AtNE/ocC lvhR/C0YyeTs9La7QI6tT8VeUmyHj12IQLc9XBynhYEF2wLZ58cgXoPZ208aQDzzp2ww OphA== X-Gm-Message-State: ALoCoQnZVkDrNCIH/oO1AQ0y9FNQUwMYf9UL/qRnFNblyLWmYYequOKHJhvXHx3KwjaGvdfgGmeq X-Received: by 10.180.104.9 with SMTP id ga9mr127853531wib.9.1420131813655; Thu, 01 Jan 2015 09:03:33 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id bo3sm4376015wjb.44.2015.01.01.09.03.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 09:03:33 -0800 (PST) From: Rickard Strandqvist To: Tony Lindgren , Russell King Subject: [PATCH] arch: arm: mach-omap2: voltage.c: Remove some unused functions Date: Thu, 1 Jan 2015 18:06:34 +0100 Message-Id: <1420131994-31636-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150101_090356_023512_2B403C47 X-CRM114-Status: GOOD ( 15.72 ) X-Spam-Score: -0.7 (/) Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rickard Strandqvist X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Removes some functions that are not used anywhere: voltdm_for_each_pwrdm() omap_change_voltscale_method() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- arch/arm/mach-omap2/voltage.c | 65 ++--------------------------------------- arch/arm/mach-omap2/voltage.h | 5 ---- 2 files changed, 3 insertions(+), 67 deletions(-) diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 3783b86..43e42fd 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -224,37 +224,6 @@ int omap_voltage_register_pmic(struct voltagedomain *voltdm, } /** - * omap_change_voltscale_method() - API to change the voltage scaling method. - * @voltdm: pointer to the VDD whose voltage scaling method - * has to be changed. - * @voltscale_method: the method to be used for voltage scaling. - * - * This API can be used by the board files to change the method of voltage - * scaling between vpforceupdate and vcbypass. The parameter values are - * defined in voltage.h - */ -void omap_change_voltscale_method(struct voltagedomain *voltdm, - int voltscale_method) -{ - if (!voltdm || IS_ERR(voltdm)) { - pr_warn("%s: VDD specified does not exist!\n", __func__); - return; - } - - switch (voltscale_method) { - case VOLTSCALE_VPFORCEUPDATE: - voltdm->scale = omap_vp_forceupdate_scale; - return; - case VOLTSCALE_VCBYPASS: - voltdm->scale = omap_vc_bypass_scale; - return; - default: - pr_warn("%s: Trying to change the method of voltage scaling to an unsupported one!\n", - __func__); - } -} - -/** * omap_voltage_late_init() - Init the various voltage parameters * * This API is to be called in the later stages of the @@ -321,10 +290,9 @@ static struct voltagedomain *_voltdm_lookup(const char *name) * @voltdm: struct voltagedomain * to add the powerdomain to * @pwrdm: struct powerdomain * to associate with a voltagedomain * - * Associate the powerdomain @pwrdm with a voltagedomain @voltdm. This - * enables the use of voltdm_for_each_pwrdm(). Returns -EINVAL if - * presented with invalid pointers; -ENOMEM if memory could not be allocated; - * or 0 upon success. + * Associate the powerdomain @pwrdm with a voltagedomain @voltdm. + * Returns -EINVAL if presented with invalid pointers; + * -ENOMEM if memory could not be allocated; or 0 upon success. */ int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm) { @@ -340,33 +308,6 @@ int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm) } /** - * voltdm_for_each_pwrdm - call function for each pwrdm in a voltdm - * @voltdm: struct voltagedomain * to iterate over - * @fn: callback function * - * - * Call the supplied function @fn for each powerdomain in the - * voltagedomain @voltdm. Returns -EINVAL if presented with invalid - * pointers; or passes along the last return value of the callback - * function, which should be 0 for success or anything else to - * indicate failure. - */ -int voltdm_for_each_pwrdm(struct voltagedomain *voltdm, - int (*fn)(struct voltagedomain *voltdm, - struct powerdomain *pwrdm)) -{ - struct powerdomain *pwrdm; - int ret = 0; - - if (!fn) - return -EINVAL; - - list_for_each_entry(pwrdm, &voltdm->pwrdm_list, voltdm_node) - ret = (*fn)(voltdm, pwrdm); - - return ret; -} - -/** * voltdm_for_each - call function on each registered voltagedomain * @fn: callback function * * diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index f7f2879..d8208f3 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h @@ -163,8 +163,6 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, unsigned long volt); int omap_voltage_register_pmic(struct voltagedomain *voltdm, struct omap_voltdm_pmic *pmic); -void omap_change_voltscale_method(struct voltagedomain *voltdm, - int voltscale_method); int omap_voltage_late_init(void); extern void omap2xxx_voltagedomains_init(void); @@ -177,9 +175,6 @@ void voltdm_init(struct voltagedomain **voltdm_list); int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm); int voltdm_for_each(int (*fn)(struct voltagedomain *voltdm, void *user), void *user); -int voltdm_for_each_pwrdm(struct voltagedomain *voltdm, - int (*fn)(struct voltagedomain *voltdm, - struct powerdomain *pwrdm)); int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); void voltdm_reset(struct voltagedomain *voltdm); unsigned long voltdm_get_voltage(struct voltagedomain *voltdm);