From patchwork Sat Jan 3 15:58:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5561971 Return-Path: X-Original-To: patchwork-linux-pm@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 A0FDABF6C3 for ; Sat, 3 Jan 2015 15:56:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97462201FB for ; Sat, 3 Jan 2015 15:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48B8C201CD for ; Sat, 3 Jan 2015 15:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751199AbbACPzx (ORCPT ); Sat, 3 Jan 2015 10:55:53 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:49898 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbbACPzw (ORCPT ); Sat, 3 Jan 2015 10:55:52 -0500 Received: by mail-wi0-f176.google.com with SMTP id ex7so962392wid.3 for ; Sat, 03 Jan 2015 07:55:50 -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=wocc+7TcTwjdn4f4WHI2RNCN4ZdHIw2FKnViCJiVI2E=; b=cjbH8MEFQYdoNfq+jdGelkMJBoOoHYFzBamM5ddVrq/sCGf9GYdCjC+yp7tMOYV4QP xUBfDnlM/3wAkHsMqEKQRGxk40Z1yqOlnw0yjQ65bWEP/JoGN4lklZIpjwkQwkiTCHdG dd1OHvgmHRYOvBhJUv/tsx2bFK5ehwf1Pvk9diyxMYC/W3P38znZMWCRem/RAxsrL1of +VQtmCRMMAubeOmcrMS9pGPEsRjkyB2UFWkiT4LYjS6uXlpctvWoiVAoZJjdEbvex5Gm lgeiOejDwrUyPEupVdsfL6tvJEidCKEFqWvuMboTzjru1fJocZSZ+Juop7lMPrvplVLA 8e+g== X-Gm-Message-State: ALoCoQm40yvguSBQ3YH5kO4l5c10eGxMW4TjMRRkcMwy9VNLu54DnR+IGtW/Ux2LcML0IbGHPQEk X-Received: by 10.180.108.235 with SMTP id hn11mr8018536wib.14.1420300549297; Sat, 03 Jan 2015 07:55:49 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id vj1sm8078587wjc.49.2015.01.03.07.55.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jan 2015 07:55:48 -0800 (PST) From: Rickard Strandqvist To: Kevin Hilman , Nishanth Menon Cc: Rickard Strandqvist , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] power: avs: smartreflex: Remove unused function Date: Sat, 3 Jan 2015 16:58:50 +0100 Message-Id: <1420300731-8910-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Remove the function sr_configure_minmax() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/power/avs/smartreflex.c | 86 ------------------------------------- include/linux/power/smartreflex.h | 1 - 2 files changed, 87 deletions(-) diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index db9973b..62b8351 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c @@ -460,92 +460,6 @@ int sr_disable_errgen(struct omap_sr *sr) } /** - * sr_configure_minmax() - Configures the SmartReflex to perform AVS using the - * minmaxavg module. - * @sr: SR module to be configured. - * - * This API is to be called from the smartreflex class driver to - * configure the minmaxavg module inside the smartreflex module. - * SR settings if using the ERROR module inside Smartreflex. - * SR CLASS 3 by default uses only the ERROR module where as - * SR CLASS 2 can choose between ERROR module and MINMAXAVG - * module. Returns 0 on success and error value in case of failure. - */ -int sr_configure_minmax(struct omap_sr *sr) -{ - u32 sr_config, sr_avgwt; - u32 senp_en = 0, senn_en = 0; - u8 senp_shift, senn_shift; - - if (!sr) { - pr_warn("%s: NULL omap_sr from %pF\n", __func__, - (void *)_RET_IP_); - return -EINVAL; - } - - if (!sr->clk_length) - sr_set_clk_length(sr); - - senp_en = sr->senp_mod; - senn_en = sr->senn_mod; - - sr_config = (sr->clk_length << SRCONFIG_SRCLKLENGTH_SHIFT) | - SRCONFIG_SENENABLE | - (sr->accum_data << SRCONFIG_ACCUMDATA_SHIFT); - - switch (sr->ip_type) { - case SR_TYPE_V1: - sr_config |= SRCONFIG_DELAYCTRL; - senn_shift = SRCONFIG_SENNENABLE_V1_SHIFT; - senp_shift = SRCONFIG_SENPENABLE_V1_SHIFT; - break; - case SR_TYPE_V2: - senn_shift = SRCONFIG_SENNENABLE_V2_SHIFT; - senp_shift = SRCONFIG_SENPENABLE_V2_SHIFT; - break; - default: - dev_err(&sr->pdev->dev, "%s: Trying to Configure smartreflex" - "module without specifying the ip\n", __func__); - return -EINVAL; - } - - sr_config |= ((senn_en << senn_shift) | (senp_en << senp_shift)); - sr_write_reg(sr, SRCONFIG, sr_config); - sr_avgwt = (sr->senp_avgweight << AVGWEIGHT_SENPAVGWEIGHT_SHIFT) | - (sr->senn_avgweight << AVGWEIGHT_SENNAVGWEIGHT_SHIFT); - sr_write_reg(sr, AVGWEIGHT, sr_avgwt); - - /* - * Enabling the interrupts if MINMAXAVG module is used. - * TODO: check if all the interrupts are mandatory - */ - switch (sr->ip_type) { - case SR_TYPE_V1: - sr_modify_reg(sr, ERRCONFIG_V1, - (ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUVALIDINTEN | - ERRCONFIG_MCUBOUNDINTEN), - (ERRCONFIG_MCUACCUMINTEN | ERRCONFIG_MCUACCUMINTST | - ERRCONFIG_MCUVALIDINTEN | ERRCONFIG_MCUVALIDINTST | - ERRCONFIG_MCUBOUNDINTEN | ERRCONFIG_MCUBOUNDINTST)); - break; - case SR_TYPE_V2: - sr_write_reg(sr, IRQSTATUS, - IRQSTATUS_MCUACCUMINT | IRQSTATUS_MCVALIDINT | - IRQSTATUS_MCBOUNDSINT | IRQSTATUS_MCUDISABLEACKINT); - sr_write_reg(sr, IRQENABLE_SET, - IRQENABLE_MCUACCUMINT | IRQENABLE_MCUVALIDINT | - IRQENABLE_MCUBOUNDSINT | IRQENABLE_MCUDISABLEACKINT); - break; - default: - dev_err(&sr->pdev->dev, "%s: Trying to Configure smartreflex" - "module without specifying the ip\n", __func__); - return -EINVAL; - } - - return 0; -} - -/** * sr_enable() - Enables the smartreflex module. * @sr: pointer to which the SR module to be configured belongs to. * @volt: The voltage at which the Voltage domain associated with diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index d8b187c3..ffd31af 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h @@ -303,7 +303,6 @@ int sr_enable(struct omap_sr *sr, unsigned long volt); void sr_disable(struct omap_sr *sr); int sr_configure_errgen(struct omap_sr *sr); int sr_disable_errgen(struct omap_sr *sr); -int sr_configure_minmax(struct omap_sr *sr); /* API to register the smartreflex class driver with the smartreflex driver */ int sr_register_class(struct omap_sr_class_data *class_data);