mirror of
https://xff.cz/git/u-boot/
synced 2025-08-31 16:22:36 +02:00
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>
This commit is contained in:
@@ -45,13 +45,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;
|
||||
|
||||
/*
|
||||
* TODO: Some of the code in spi_init() should probably move
|
||||
* here, or into spi_claim_bus() below.
|
||||
|
Reference in New Issue
Block a user