From patchwork Wed Apr 4 09:42:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 7614 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 B88EC23E4C for ; Wed, 4 Apr 2012 09:42:53 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 820DDA186C3 for ; Wed, 4 Apr 2012 09:42:53 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so109604iag.11 for ; Wed, 04 Apr 2012 02:42:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=YRz6LqRHLmJmJUTYA/92CxIMkZJzfytU65YzYh3TTkM=; b=WaHEd62+JdMP3BrzWOHcI3ACHOhn0A/zYXAr2yXDwFJolu9wGtBOfkqImgTi2Hkamd No9PIfPrZjTWWOcFH0B02QJ0YX0PaL2yJOvcyxMahAiWazkK1FK3X2oWP7xTMv02TOFp /TQXz2aAxSj0yI+Lj8r0moxsYHxnpB8TfwRzVGgAqt4w9GK0gX4dPMjov3IlXQo5NJDM oC/GmY3nz5zK/iDLZ/eJH3a1SVL69PIejVV2+NKin3ovEmUy6ceZ/d00mKJl0PxUK2hH 0dGTvngKpS9J+6cb1kOMK+fhqeAZMMch4x4taz82BCXfT16NLaCmuU+CBYm4Eprv6Ytc V0bw== Received: by 10.50.173.35 with SMTP id bh3mr920246igc.38.1333532573335; Wed, 04 Apr 2012 02:42:53 -0700 (PDT) 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.231.164.217 with SMTP id f25csp31274iby; Wed, 4 Apr 2012 02:42:52 -0700 (PDT) Received: by 10.180.101.8 with SMTP id fc8mr3673840wib.12.1333532571789; Wed, 04 Apr 2012 02:42:51 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id c7si177290wia.20.2012.04.04.02.42.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 02:42:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 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-wi0-f172.google.com with SMTP id hj6so283245wib.13 for ; Wed, 04 Apr 2012 02:42:51 -0700 (PDT) Received: by 10.180.82.136 with SMTP id i8mr3587240wiy.19.1333532571370; Wed, 04 Apr 2012 02:42:51 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-7-136.w90-60.abo.wanadoo.fr. [90.60.242.136]) by mx.google.com with ESMTPS id bx13sm3462265wib.10.2012.04.04.02.42.49 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 02:42:50 -0700 (PDT) From: Daniel Lezcano To: tony@atomide.com, khilman@ti.com Cc: j-pihet@ti.com, santosh.shilimkar@ti.com, rob.lee@linaro.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 17/17] ARM: OMAP3: cpuidle - set global variables static Date: Wed, 4 Apr 2012 11:42:19 +0200 Message-Id: <1333532539-10298-18-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333532539-10298-1-git-send-email-daniel.lezcano@linaro.org> References: <1333532539-10298-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkzMjaipLna0OYs/zFMpVZxBqX/Z3vLnTJKUsynphWkEF7O9TU1vLAznOmXHIdC+3UjfOyR and check the powerdomain lookup is successful. Signed-off-by: Daniel Lezcano --- arch/arm/mach-omap2/cpuidle34xx.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 882d349..413aac4 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -75,7 +75,7 @@ static struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES] = { }, }; -struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; +static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd; static int _cpuidle_allow_idle(struct powerdomain *pwrdm, struct clockdomain *clkdm) @@ -364,6 +364,9 @@ int __init omap3_idle_init(void) per_pd = pwrdm_lookup("per_pwrdm"); cam_pd = pwrdm_lookup("cam_pwrdm"); + if (!mpu_pd || !core_pd || !per_pd || !cam_pd) + return -ENODEV; + /* * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot * enable OFF mode in a stable form for previous revisions.