Merge branch 'acpi-config'
[firefly-linux-kernel-4.4.55.git] / drivers / cpufreq / spear-cpufreq.c
index 4cfdcff8a3109826195979495f307c4ff1902d65..38678396636da49d689cde51ec49fc850f912a0b 100644 (file)
@@ -195,18 +195,15 @@ static int spear_cpufreq_probe(struct platform_device *pdev)
        cnt = prop->length / sizeof(u32);
        val = prop->value;
 
-       freq_tbl = kmalloc(sizeof(*freq_tbl) * (cnt + 1), GFP_KERNEL);
+       freq_tbl = kzalloc(sizeof(*freq_tbl) * (cnt + 1), GFP_KERNEL);
        if (!freq_tbl) {
                ret = -ENOMEM;
                goto out_put_node;
        }
 
-       for (i = 0; i < cnt; i++) {
-               freq_tbl[i].driver_data = i;
+       for (i = 0; i < cnt; i++)
                freq_tbl[i].frequency = be32_to_cpup(val++);
-       }
 
-       freq_tbl[i].driver_data = i;
        freq_tbl[i].frequency = CPUFREQ_TABLE_END;
 
        spear_cpufreq.freq_tbl = freq_tbl;