From patchwork Wed Apr 4 20:12:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 7649 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 39B8823E47 for ; Wed, 4 Apr 2012 20:13:29 +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 023E4A186F6 for ; Wed, 4 Apr 2012 20:13:28 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so1063293iag.11 for ; Wed, 04 Apr 2012 13:13:28 -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=v/wzdOzE4ffddVmW36h3Y+D6ePGl38SD53lBvKVQdmQ=; b=FOeR/OLWZZr64tYvB51ncv3YbuoFDPaLNJvl3f6t5aC3sEbFZ+GhFjhr8srH/XDWKu 0Hz91xWcSnr+LqvQYGZnMNUTxbJI4QB8aNqzVdNz+uELnrseTIPLQI7Q+S/ojq4yAfUG QLneyJcDcrzjigdgywU8eFT4HCWTOgeTJwceZlXeMV7UjmaRMZ2kzeevsVn5WwxI75Q8 KIsuTTVROV5N38x4iaPx81QRL00nA3ES4TqVwfZSVj2v/3KGwGAjWmydt1R96tIj7gSq OgXhGvXzbnxlgSBx8jjwW5N6SX2wv/CS77lqI6AESNLQSWPol3egLgeeUzRAAGHhHdxQ YKgg== Received: by 10.50.194.232 with SMTP id hz8mr2826218igc.38.1333570408803; Wed, 04 Apr 2012 13:13:28 -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 f25csp56500iby; Wed, 4 Apr 2012 13:13:28 -0700 (PDT) Received: by 10.14.203.67 with SMTP id e43mr3369372eeo.93.1333570407055; Wed, 04 Apr 2012 13:13:27 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id n52si1979021wed.91.2012.04.04.13.13.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 13:13:27 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-wg0-f50.google.com with SMTP id ds12so644793wgb.31 for ; Wed, 04 Apr 2012 13:13:26 -0700 (PDT) Received: by 10.216.203.146 with SMTP id f18mr2212840weo.21.1333570406406; Wed, 04 Apr 2012 13:13:26 -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 gd4sm6869495wib.6.2012.04.04.13.13.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 13:13:25 -0700 (PDT) From: Daniel Lezcano To: santosh.shilimkar@ti.com, jean.pihet@newoldbits.com, khilman@ti.com, tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rob.lee@linaro.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 17/17][V2] ARM: OMAP3: cpuidle - set global variables static Date: Wed, 4 Apr 2012 22:12:51 +0200 Message-Id: <1333570371-1389-18-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333570371-1389-1-git-send-email-daniel.lezcano@linaro.org> References: <1333570371-1389-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmDyE92sRJBXm1gRid09r0M36bBE6SSWmbRUC2HGOrHB4aWHVd49ruaaa+vjuVHOyoUigdd and check the powerdomain lookup is successful. Signed-off-by: Daniel Lezcano Reviewed-by: Jean Pihet --- 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.