From: Paul Walmsley <[email protected]>

Use sane values for the smartreflex data from the e-fuses.

Signed-off-by: Paul Walmsley <[email protected]>
Signed-off-by: Jean Pihet <[email protected]>
---
 arch/arm/mach-omap2/sr_device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 9f43fcc..221407a 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -38,11 +38,18 @@ static void __init sr_set_nvalues(struct omap_volt_data 
*volt_data,
        struct omap_sr_nvalue_table *nvalue_table;
        int i, count = 0;
 
+       sr_data->nvalue_count = 0;
+       sr_data->nvalue_table = NULL;
+
        while (volt_data[count].volt_nominal)
                count++;
 
        nvalue_table = kzalloc(sizeof(struct omap_sr_nvalue_table)*count,
                        GFP_KERNEL);
+       if (!nvalue_table) {
+               pr_err("OMAP: SmartReflex: cannot allocate memory for n-value 
table\n");
+               return;
+       }
 
        for (i = 0; i < count; i++) {
                u32 v;
-- 
1.7.5.4

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

Reply via email to