]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/sh_spi.c
ARM: AM43xx: Add build support
[u-boot] / drivers / spi / sh_spi.c
index e944b23c2df355936e724d4013bb217f185ad13a..744afe3295aebeca01ad9e1921ce387c0c823dbb 100644 (file)
@@ -103,12 +103,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        if (!spi_cs_is_valid(bus, cs))
                return NULL;
 
-       ss = malloc(sizeof(struct spi_slave));
+       ss = spi_alloc_slave(struct sh_spi, bus, cs);
        if (!ss)
                return NULL;
 
-       ss->slave.bus = bus;
-       ss->slave.cs = cs;
        ss->regs = (struct sh_spi_regs *)CONFIG_SH_SPI_BASE;
 
        /* SPI sycle stop */