Merge branch 'spi-4.18' into spi-linus
[muen/linux.git] / drivers / spi / spi-davinci.c
index 4ffc0f495be83e20cfe1ed042b27b3e7ca2c1b41..a02099c90c5c2ec64d0315bf93799dcae79fe539 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;