diff options
author | Simon Glass <sjg@chromium.org> | 2013-03-11 06:08:03 +0000 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2013-03-19 08:45:36 -0700 |
commit | c0f87dd4ffa0c012d1dc8f737412c58200a93c93 (patch) | |
tree | ad8bc5cfdeac09a81bde0f16626b0625d7bcc836 /drivers/mtd/spi/ramtron.c | |
parent | b5aec1424d191c51f694ba85d5577e7a635363d9 (diff) |
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 <sjg@chromium.org>
Diffstat (limited to 'drivers/mtd/spi/ramtron.c')
-rw-r--r-- | drivers/mtd/spi/ramtron.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/spi/ramtron.c b/drivers/mtd/spi/ramtron.c index 0999781496..5299a6dbde 100644 --- a/drivers/mtd/spi/ramtron.c +++ b/drivers/mtd/spi/ramtron.c @@ -284,15 +284,13 @@ struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode) return NULL; found: - sn = malloc(sizeof(*sn)); + sn = spi_flash_alloc(struct ramtron_spi_fram, spi, params->name); if (!sn) { debug("SF: Failed to allocate memory\n"); return NULL; } sn->params = params; - sn->flash.spi = spi; - sn->flash.name = params->name; sn->flash.write = ramtron_write; sn->flash.read = ramtron_read; |