From patchwork Fri Feb 1 13:48:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2080841 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork1.kernel.org (Postfix) with ESMTP id 0FD6740106 for ; Fri, 1 Feb 2013 13:52:11 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r11DmaIa011482; Fri, 1 Feb 2013 07:48:36 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r11Dmalk024096; Fri, 1 Feb 2013 07:48:36 -0600 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Fri, 1 Feb 2013 07:48:35 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r11DmZY6010178; Fri, 1 Feb 2013 07:48:35 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 800F080628; Fri, 1 Feb 2013 07:48:35 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 7F49B8062A for ; Fri, 1 Feb 2013 07:48:32 -0600 (CST) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id r11DmWtL027093 for ; Fri, 1 Feb 2013 07:48:32 -0600 (CST) Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id r11DmVlJ013828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Feb 2013 07:48:32 -0600 Received: from [216.82.242.147:11761] by server-5.bemta-8.messagelabs.com id AF/8F-01137-FA7CB015; Fri, 01 Feb 2013 13:48:31 +0000 X-Env-Sender: daniel.lezcano@linaro.org X-Msg-Ref: server-8.tower-95.messagelabs.com!1359726509!21104321!1 X-Originating-IP: [209.85.212.178] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3940 invoked from network); 1 Feb 2013 13:48:30 -0000 Received: from mail-wi0-f178.google.com (HELO mail-wi0-f178.google.com) (209.85.212.178) by server-8.tower-95.messagelabs.com with RC4-SHA encrypted SMTP; 1 Feb 2013 13:48:30 -0000 Received: by mail-wi0-f178.google.com with SMTP id o1so596866wic.5 for ; Fri, 01 Feb 2013 05:48:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=Gzh3prByEGZ857dULDVpIRxvVy9JFRJQzQHAeeRyUC4=; b=eGDi/cGRUgkv/POhbn6PeJrS/mhtadYsQYgPuzaIMYPSWwhdz6DGfAhUd4lcggoL1h RCZQBQtqqGQt0pWdehIywWGxGF/5jqhdfF+6NZDo3eVfYUedgVPuu2usR9lqMq6T/UBO PdW2B6CRmUY2kzsgZf4B4u0NO4X8GfUGcn/BnC0I08mzQNqvhk+RoSe+WR5Y8YQmK6Fa GJDhQIJFKvt9PRRFFvsCkJTGvpz6E+1lzxhFDTcEuA7H/EGVj5sdW7BEs+B6lRNBMaEz o8fZgqkwvweCS7zaRbc7M/LRpCMXbHOU+APAwyr2EJiPA3xv3FkWkOSj7yoagoW/zOAs 8GRg== X-Received: by 10.180.87.98 with SMTP id w2mr3009300wiz.30.1359726501608; Fri, 01 Feb 2013 05:48:21 -0800 (PST) Received: from mai.home (AToulouse-654-1-332-150.w86-199.abo.wanadoo.fr. [86.199.219.150]) by mx.google.com with ESMTPS id bd7sm3692703wib.8.2013.02.01.05.48.20 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Feb 2013 05:48:20 -0800 (PST) From: Daniel Lezcano To: , Subject: [PATCH 3/4] davinci: cpuidle - remove the ops Date: Fri, 1 Feb 2013 14:48:14 +0100 Message-ID: <1359726495-8024-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359726495-8024-1-git-send-email-daniel.lezcano@linaro.org> References: <1359726495-8024-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlcyMFkBxPAw3qqmVlFuAeqCySf1nAK3gAR3AZiNJc27JpILfTf0+L/Gw30Dk2rO/T6R8C9 CC: , , , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com With one function handling the idle state and a single variable, the usage of the davinci_ops is overkill. This patch removes these ops and simplify the code. Furthermore, the 'driver_data' field is no longer used, we have 1 of the 3 remaining user of this field removed. Signed-off-by: Daniel Lezcano --- arch/arm/mach-davinci/cpuidle.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index 9438672..28cc8e8 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c @@ -25,12 +25,6 @@ #define DAVINCI_CPUIDLE_MAX_STATES 2 -struct davinci_ops { - void (*enter) (void); - void (*exit) (void); - u32 flags; -}; - static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); static void __iomem *ddr2_reg_base; static bool ddr2_pdown = false; @@ -54,39 +48,17 @@ static void davinci_save_ddr_power(int enter, bool pdown) __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET); } -static void davinci_c2state_enter(void) -{ - davinci_save_ddr_power(1, ddr2_pdown); -} - -static void davinci_c2state_exit(void) -{ - davinci_save_ddr_power(0, ddr2_pdown); -} - -static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = { - [1] = { - .enter = davinci_c2state_enter, - .exit = davinci_c2state_exit, - }, -}; - /* Actual code that puts the SoC in different idle states */ static int davinci_enter_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; - struct davinci_ops *ops = cpuidle_get_statedata(state_usage); - - if (ops && ops->enter) - ops->enter(); + davinci_save_ddr_power(1, ddr2_pdown); index = cpuidle_wrap_enter(dev, drv, index, arm_cpuidle_simple_enter); - if (ops && ops->exit) - ops->exit(); + davinci_save_ddr_power(0, ddr2_pdown); return index; } @@ -123,7 +95,6 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev) ddr2_reg_base = pdata->ddr2_ctlr_base; ddr2_pdown = pdata->ddr2_pdown; - cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]); device->state_count = DAVINCI_CPUIDLE_MAX_STATES;