diff options
author | Simon Glass <sjg@chromium.org> | 2013-03-18 19:23:40 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2013-03-19 15:45:36 (GMT) |
commit | d3504fee73ec626117427afa08116d1dde21ba9d (patch) | |
tree | 04b3d508a3ce15c1e67baf76cf964aedf3c559a7 /drivers/spi/kirkwood_spi.c | |
parent | ba6c3ce9bd0ac572592dc909878117dce219c564 (diff) | |
download | u-boot-fsl-qoriq-d3504fee73ec626117427afa08116d1dde21ba9d.tar.xz |
spi: Use spi_alloc_slave() in each SPI driver
Rather than each driver having its own way to allocate a SPI slave,
use the new allocation function everywhere. This will make it easier
to extend the interface without breaking drivers.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/spi/kirkwood_spi.c')
-rw-r--r-- | drivers/spi/kirkwood_spi.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c index de81064..caa91e3 100644 --- a/drivers/spi/kirkwood_spi.c +++ b/drivers/spi/kirkwood_spi.c @@ -49,13 +49,10 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, if (!spi_cs_is_valid(bus, cs)) return NULL; - slave = malloc(sizeof(struct spi_slave)); + slave = spi_alloc_slave_base(bus, cs); if (!slave) return NULL; - slave->bus = bus; - slave->cs = cs; - writel(~KWSPI_CSN_ACT | KWSPI_SMEMRDY, &spireg->ctrl); /* calculate spi clock prescaller using max_hz */ |