* [PATCH] OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined
@ 2009-05-19 12:37 Roger Quadros
2009-05-19 16:54 ` Kevin Hilman
0 siblings, 1 reply; 2+ messages in thread
From: Roger Quadros @ 2009-05-19 12:37 UTC (permalink / raw)
To: khilman; +Cc: linux-omap
Prevent SmartReflex driver driver from loading if OPP tables are
not defined by platform. This removes possibility of NULL pointer
reference in SmartReflex driver code.
Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
---
arch/arm/mach-omap2/smartreflex.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index b032366..4823ce8 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -852,6 +852,12 @@ static int __init omap3_sr_init(void)
int ret = 0;
u8 RdReg;
+ /* Exit if OPP tables are not defined */
+ if (!(mpu_opps && l3_opps)) {
+ pr_err("SR: OPP rate tables not defined for platform, not enabling SmartReflex\n");
+ return -ENODEV;
+ }
+
/* Enable SR on T2 */
ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg,
R_DCDC_GLOBAL_CFG);
--
1.6.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined
2009-05-19 12:37 [PATCH] OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined Roger Quadros
@ 2009-05-19 16:54 ` Kevin Hilman
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2009-05-19 16:54 UTC (permalink / raw)
To: Roger Quadros; +Cc: linux-omap
Roger Quadros <ext-roger.quadros@nokia.com> writes:
> Prevent SmartReflex driver driver from loading if OPP tables are
> not defined by platform. This removes possibility of NULL pointer
> reference in SmartReflex driver code.
>
> Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Thanks, pushing to PM branch.
Kevin
> ---
> arch/arm/mach-omap2/smartreflex.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index b032366..4823ce8 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -852,6 +852,12 @@ static int __init omap3_sr_init(void)
> int ret = 0;
> u8 RdReg;
>
> + /* Exit if OPP tables are not defined */
> + if (!(mpu_opps && l3_opps)) {
> + pr_err("SR: OPP rate tables not defined for platform, not enabling SmartReflex\n");
> + return -ENODEV;
> + }
> +
> /* Enable SR on T2 */
> ret = twl4030_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &RdReg,
> R_DCDC_GLOBAL_CFG);
> --
> 1.6.0.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-19 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 12:37 [PATCH] OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined Roger Quadros
2009-05-19 16:54 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox