]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/spi/sf_probe.c
sf: Squash the malloc+memset combo
[karo-tx-uboot.git] / drivers / mtd / spi / sf_probe.c
index bc3cf6cc64aaa3bb324e3a360882a78725552696..e84ab1363bd3a7aacee59d2bdcac694716e49d97 100644 (file)
@@ -123,12 +123,11 @@ static struct spi_flash *spi_flash_validate_params(struct spi_slave *spi,
                return NULL;
        }
 
-       flash = malloc(sizeof(*flash));
+       flash = calloc(1, sizeof(*flash));
        if (!flash) {
                debug("SF: Failed to allocate spi_flash\n");
                return NULL;
        }
-       memset(flash, '\0', sizeof(*flash));
 
        /* Assign spi data */
        flash->spi = spi;