]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/spi/mpc52xx_spi.c
spi: Use spi_alloc_slave() in each SPI driver
[karo-tx-uboot.git] / drivers / spi / mpc52xx_spi.c
index 3e96b3f9f3b88fa997667a931650d76d8bdf9667..4b50bca880a8bdc9420d4163b0913bfe9f1a019d 100644 (file)
@@ -48,13 +48,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 {
        struct spi_slave *slave;
 
-       slave = malloc(sizeof(struct spi_slave));
+       slave = spi_alloc_slave_base(bus, cs);
        if (!slave)
                return NULL;
 
-       slave->bus = bus;
-       slave->cs = cs;
-
        return slave;
 }