From c0f87dd4ffa0c012d1dc8f737412c58200a93c93 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 11 Mar 2013 06:08:03 +0000 Subject: sf: Use spi_flash_alloc() in each SPI flash driver Rather than each device having its own way to allocate a SPI flash structure, use the new allocation function everywhere. This will make it easier to extend the interface without breaking devices. Signed-off-by: Simon Glass --- drivers/mtd/spi/eon.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/mtd/spi/eon.c') diff --git a/drivers/mtd/spi/eon.c b/drivers/mtd/spi/eon.c index 691ed4e..b16e7ab 100644 --- a/drivers/mtd/spi/eon.c +++ b/drivers/mtd/spi/eon.c @@ -46,18 +46,12 @@ struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode) return NULL; } - flash = malloc(sizeof(*flash)); + flash = spi_flash_alloc_base(spi, params->name); if (!flash) { debug("SF: Failed to allocate memory\n"); return NULL; } - flash->spi = spi; - flash->name = params->name; - - flash->write = spi_flash_cmd_write_multi; - flash->erase = spi_flash_cmd_erase; - flash->read = spi_flash_cmd_read_fast; flash->page_size = 256; flash->sector_size = 256 * 16 * 16; flash->size = 256 * 16 -- cgit v1.1