public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] spi: tegra114_spi: Convert to use spi_alloc_slave()
@ 2013-06-13  8:17 Axel Lin
  2013-06-13  8:21 ` [U-Boot] [PATCH 2/2] spi: tegra20_sflash: Remove redundant code to set bus and cs of struct spi_slave Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Axel Lin @ 2013-06-13  8:17 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Forgot to CC mailing list, so here is a resend.
 drivers/spi/tegra114_spi.c | 4 +---
 1 file changed, 1 insertion(+), 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",
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-13 17:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13  8:17 [U-Boot] [PATCH 1/2] spi: tegra114_spi: Convert to use spi_alloc_slave() Axel Lin
2013-06-13  8:21 ` [U-Boot] [PATCH 2/2] spi: tegra20_sflash: Remove redundant code to set bus and cs of struct spi_slave Axel Lin
2013-06-13 10:48   ` Marek Vasut
2013-06-13 14:08     ` Jagan Teki
2013-06-13 17:33   ` [U-Boot] [U-Boot, " Jagan Teki
2013-06-13 10:48 ` [U-Boot] [PATCH 1/2] spi: tegra114_spi: Convert to use spi_alloc_slave() Marek Vasut
2013-06-13 14:08   ` Jagan Teki
2013-06-13 17:33 ` [U-Boot] [U-Boot, " Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox