]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/spi/andes_spi.c
spi: Use spi_alloc_slave() in each SPI driver
[karo-tx-uboot.git] / drivers / spi / andes_spi.c
index fdde13954b18a0aac466f5e9852637fa65e4c033..c56377b63501ecf6e7a75f84b0c3c2db47082fc1 100644 (file)
@@ -53,12 +53,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        if (!spi_cs_is_valid(bus, cs))
                return NULL;
 
-       ds = malloc(sizeof(*ds));
+       ds = spi_alloc_slave(struct andes_spi_slave, bus, cs);
        if (!ds)
                return NULL;
 
-       ds->slave.bus = bus;
-       ds->slave.cs = cs;
        ds->regs = (struct andes_spi_regs *)CONFIG_SYS_SPI_BASE;
 
        /*