From 12eb49d76f3f20b38f38ad508186c1b8a15245b5 Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Tue, 19 May 2009 15:37:51 +0300 Subject: [PATCH] OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined 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 --- arch/arm/mach-omap2/smartreflex.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 036683c185e..d8d10fdccb4 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -906,6 +906,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); -- 2.11.4.GIT