Re: [PATCH 02/13] OMAP2/3: PM: push core PM code from linux-omap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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.)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux