Re: [PATCH 3/3 v2] OMAP3: remove OPP interfaces from OMAP PM layer

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

 



* Nishanth Menon <nm@xxxxxx> [101019 17:53]:
>  static int __init omap2_common_pm_init(void)
>  {
>  	omap2_init_processor_devices();
> +
> +	if (cpu_is_omap34xx() || cpu_is_omap44xx())
> +		omap_init_opp_table();
> +
>  	omap_pm_if_init();

It's best to have separate init for each supported processor instead:

static init __init omap3_opp_init(void)
{
	if (cpu_is_not_omap34xx())
		return -ENODEV;

	/* Do omap3 specific init */
	...

	return omap_opp_init(omap3_opp_def_list);
}
device_initcall(omap3_opp_init);

static init __init omap4_opp_init(void)
{
	if (cpu_is_not_omap44xx())
		return -ENODEV;

	/* Do omap3 specific init */
	...

	return omap_opp_init(omap4_opp_def_list);
}
device_initcall(omap4_opp_init);
...

This way it's easier to add support for new processors by
implementing the necessary initcalls, common code stays
generic, one level of code indentation is avoided, and
the code still gets optimized out for unselected processors.

Regards,

Tony

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