From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Hilman Subject: Re: [PATCH 02/13] OMAP2/3: PM: push core PM code from linux-omap Date: Thu, 28 May 2009 09:51:18 -0700 Message-ID: <87y6shp3w9.fsf@deeprootsystems.com> References: <1242861576-13008-1-git-send-email-khilman@deeprootsystems.com> <1242861576-13008-2-git-send-email-khilman@deeprootsystems.com> <1242861576-13008-3-git-send-email-khilman@deeprootsystems.com> <20090528154823.GD20736@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pz0-f177.google.com ([209.85.222.177]:55431 "EHLO mail-pz0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754736AbZE1QvS (ORCPT ); Thu, 28 May 2009 12:51:18 -0400 Received: by pzk7 with SMTP id 7so4323591pzk.33 for ; Thu, 28 May 2009 09:51:20 -0700 (PDT) In-Reply-To: <20090528154823.GD20736@n2100.arm.linux.org.uk> (Russell King's message of "Thu\, 28 May 2009 16\:48\:23 +0100") Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Russell King - ARM Linux Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-omap@vger.kernel.org Russell King - ARM Linux writes: > On Wed, May 20, 2009 at 04:19:25PM -0700, Kevin Hilman wrote: >> This patch is to sync the core linux-omap PM code with mainline. This >> code has evolved and been used for a while the linux-omap tree, but >> the attempt here is to finally get this into mainline. > > Hmm.. > >> +static int __init omap_pm_init(void) >> { >> - return 0; >> + int error = -1; >> + >> + if (cpu_is_omap24xx()) >> + error = omap2_pm_init(); >> + if (cpu_is_omap34xx()) >> + error = omap3_pm_init(); > > Experience with PXA has shown that this tends to be the wrong way up > of doing things. It seems to be much better to have the SoC specific > code call the SoC generic code instead. OK. > So, eg, omap2_pm_init() becomes: > > static int omap2_pm_init(void) > { > if (!cpu_is_omap24xx()) > return -ENODEV; > > ... omap24xx initialisation ... > > return omap_pm_init(); > } > late_initcall(omap2_pm_init); > > (and, since this is always built-in, there's no point doing cleanup if > omap_pm_init() fails - you're not going to be able to re-run that > initialization again.) Sounds good, I'll make this change and upate the pm-upstream branch for Tony. This will leave the common omap_pm_init() and pm.c basically empty, so I'll just remove them. Kevin