X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fspi%2Fandes_spi.c;h=c56377b63501ecf6e7a75f84b0c3c2db47082fc1;hb=dcfe863838becd4cf4dba4d89aef2332150fe90f;hp=fdde13954b18a0aac466f5e9852637fa65e4c033;hpb=1902692aa0b2dcbb9351172be03c57d1e82447e4;p=u-boot diff --git a/drivers/spi/andes_spi.c b/drivers/spi/andes_spi.c index fdde13954b..c56377b635 100644 --- a/drivers/spi/andes_spi.c +++ b/drivers/spi/andes_spi.c @@ -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; /*