Merge branch 'spi-4.18' into spi-linus
[platform/kernel/linux-starfive.git] / drivers / spi / spi-davinci.c
index 4ffc0f4..a02099c 100644 (file)
@@ -923,9 +923,10 @@ static int davinci_spi_probe(struct platform_device *pdev)
        /* pdata in dspi is now updated and point pdata to that */
        pdata = &dspi->pdata;
 
-       dspi->bytes_per_word = devm_kzalloc(&pdev->dev,
-                                           sizeof(*dspi->bytes_per_word) *
-                                           pdata->num_chipselect, GFP_KERNEL);
+       dspi->bytes_per_word = devm_kcalloc(&pdev->dev,
+                                           pdata->num_chipselect,
+                                           sizeof(*dspi->bytes_per_word),
+                                           GFP_KERNEL);
        if (dspi->bytes_per_word == NULL) {
                ret = -ENOMEM;
                goto free_master;