summaryrefslogtreecommitdiff
path: root/drivers/spi/mpc8xxx_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/mpc8xxx_spi.c')
-rw-r--r--drivers/spi/mpc8xxx_spi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
index 4e46041..6b0e3b4 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -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.