]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/spi/eon.c
Merge 'u-boot-microblaze/zynq' into (u-boot-arm/master'
[karo-tx-uboot.git] / drivers / mtd / spi / eon.c
index d9d43ca57e19de46864939c6fab4791697621366..25cfc1252c406e1a73c5e82a1885eefc038c2d1e 100644 (file)
@@ -27,11 +27,6 @@ static const struct eon_spi_flash_params eon_spi_flash_table[] = {
                .nr_sectors = 4096,
                .name = "EN25Q128",
        },
-       {
-               .idcode1 = 0x16,
-               .nr_sectors = 1024,
-               .name = "EN25Q32B",
-       },
 };
 
 struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
@@ -51,22 +46,15 @@ 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
-           * params->nr_sectors;
+       flash->size = 256 * 16 * params->nr_sectors;
 
        return flash;
 }