From patchwork Mon Feb 4 12:01:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 14525 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 26CD423F96 for ; Mon, 4 Feb 2013 12:01:58 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id BA7E2A19370 for ; Mon, 4 Feb 2013 12:01:57 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id p16so3838990vcq.15 for ; Mon, 04 Feb 2013 04:01:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=3qJxmtQnpUu/sXLujb0zelTtt+D5joEFkw3J7HeVXuY=; b=akmrKxXf3zxzn1xU0viRBdTy8+u087w8Y7Sfb0j/vTKl30llOjGpmouFsMK7cHsxUR nUwvQj7gPz9819nuuNj/bjQhfPSlsMpiNcSiDZukEhmJ5Qnm2MzWyPQ3/JRoLR6UUnPS e7+uNQy8wwNAzhnVpOAYPfzv/tkMzoPhqaOQtKikqzUjyr9KGUwc1ekiM+gpPSD5XkFh A0A8XhuIqvJiIRbS+lNR6hMzXf0nHAGxwIqmoin7Mh9Bj/g2W6anDvpp712oCEqwGq6y ow0BhSqBggLQSTz3PporQIcHFlM026VIzOGhcCZb/xFXWjOYEK6Ypyg/kljWljhZIuEx tFIw== X-Received: by 10.52.24.98 with SMTP id t2mr15786817vdf.69.1359979317170; Mon, 04 Feb 2013 04:01:57 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp83314vec; Mon, 4 Feb 2013 04:01:56 -0800 (PST) X-Received: by 10.180.82.41 with SMTP id f9mr9900415wiy.25.1359979316322; Mon, 04 Feb 2013 04:01:56 -0800 (PST) Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]) by mx.google.com with ESMTPS id pi6si5716634wjb.204.2013.02.04.04.01.56 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:01:56 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22f is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c03::22f; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::22f is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-we0-f175.google.com with SMTP id x8so4766504wey.20 for ; Mon, 04 Feb 2013 04:01:56 -0800 (PST) X-Received: by 10.180.72.148 with SMTP id d20mr9834495wiv.31.1359979315922; Mon, 04 Feb 2013 04:01:55 -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 j9sm12967916wia.5.2013.02.04.04.01.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 04:01:55 -0800 (PST) From: Daniel Lezcano To: khilman@deeprootsystems.com, nsekhar@ti.com Cc: patches@linaro.org, linaro-dev@lists.linaro.org, davinci-linux-open-source@linux.davincidsp.com, lenb@kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 3/4][V2] davinci: cpuidle - remove the ops Date: Mon, 4 Feb 2013 13:01:43 +0100 Message-Id: <1359979304-8715-4-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359979304-8715-1-git-send-email-daniel.lezcano@linaro.org> References: <1359979304-8715-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQlsoFyP/3fEL+l3YaRaxGLAOMa/VJNRnfuW7Gf3Rz1FzYsqCZ9m3N46D7P+880Yz59r2Un7 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 Acked-by: Sekhar Nori --- 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 697febe..5e430bf 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; @@ -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;