summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-06-13 16:17:47 +0800
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-06-13 22:55:24 +0530
commitd6f64d4a11c2aa4318b20eeda04c564728705080 (patch)
tree74633fdd8859c271d01928918c9a6790a97b3e26 /drivers/spi
parent0368292954c70d0413f849cb3d45b403beffeaa6 (diff)
downloadu-boot-imx-d6f64d4a11c2aa4318b20eeda04c564728705080.zip
u-boot-imx-d6f64d4a11c2aa4318b20eeda04c564728705080.tar.gz
u-boot-imx-d6f64d4a11c2aa4318b20eeda04c564728705080.tar.bz2
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/tegra114_spi.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index b11a0a1..4d2af48 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -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",