Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[linux-2.6-microblaze.git] / drivers / mfd / qcom-pm8xxx.c
index f08758f..e6e8d81 100644 (file)
@@ -563,8 +563,8 @@ static int pm8xxx_probe(struct platform_device *pdev)
        pr_info("PMIC revision 2: %02X\n", val);
        rev |= val << BITS_PER_BYTE;
 
-       chip = devm_kzalloc(&pdev->dev, sizeof(*chip) +
-                           sizeof(chip->config[0]) * data->num_irqs,
+       chip = devm_kzalloc(&pdev->dev,
+                           struct_size(chip, config, data->num_irqs),
                            GFP_KERNEL);
        if (!chip)
                return -ENOMEM;