mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-30 00:21:06 +00:00
spi: tegra114_spi: Convert to use spi_alloc_slave()
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
This commit is contained in:
parent
0368292954
commit
d6f64d4a11
1 changed files with 1 additions and 3 deletions
|
@ -152,13 +152,11 @@ struct spi_slave *tegra114_spi_setup_slave(unsigned int bus, unsigned int cs,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
spi = malloc(sizeof(struct tegra_spi_slave));
|
||||
spi = spi_alloc_slave(struct tegra_spi_slave, bus, cs);
|
||||
if (!spi) {
|
||||
printf("SPI error: malloc of SPI structure failed\n");
|
||||
return NULL;
|
||||
}
|
||||
spi->slave.bus = bus;
|
||||
spi->slave.cs = cs;
|
||||
spi->ctrl = &spi_ctrls[bus];
|
||||
if (!spi->ctrl) {
|
||||
printf("SPI error: could not find controller for bus %d\n",
|
||||
|
|
Loading…
Reference in a new issue