Merge tag 'pci-v5.0-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[platform/kernel/linux-starfive.git] / drivers / mfd / htc-i2cpld.c
index 3f9eee5..01572b5 100644 (file)
@@ -477,12 +477,12 @@ static int htcpld_setup_chips(struct platform_device *pdev)
 
        /* Setup each chip's output GPIOs */
        htcpld->nchips = pdata->num_chip;
-       htcpld->chip = devm_kzalloc(dev, sizeof(struct htcpld_chip) * htcpld->nchips,
+       htcpld->chip = devm_kcalloc(dev,
+                                   htcpld->nchips,
+                                   sizeof(struct htcpld_chip),
                                    GFP_KERNEL);
-       if (!htcpld->chip) {
-               dev_warn(dev, "Unable to allocate memory for chips\n");
+       if (!htcpld->chip)
                return -ENOMEM;
-       }
 
        /* Add the chips as best we can */
        for (i = 0; i < htcpld->nchips; i++) {