summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/spansion.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-04 22:56:52 -0500
committerMike Frysinger <vapier@gentoo.org>2012-03-04 22:56:52 -0500
commita4ed3b653163367628d4ad173dfe3faf388da0ac (patch)
treead5f783584741dbcd8c0b00bd3fff595a8fb4643 /drivers/mtd/spi/spansion.c
parentb98b611502f5e0a85a1f8e15cf46c470cb105614 (diff)
sf: inline data constants
I imagine much of these constants are due to copy & pasting previous drivers rather than an actual reflection of the hardware layout. At any rate, inline the info that we don't care about externally as it shrinks things nicely. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/mtd/spi/spansion.c')
-rw-r--r--drivers/mtd/spi/spansion.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index 457cc06298..bedde0760d 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -38,7 +38,6 @@
struct spansion_spi_flash_params {
u16 idcode1;
u16 idcode2;
- u16 page_size;
u16 pages_per_sector;
u16 nr_sectors;
const char *name;
@@ -48,7 +47,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x0213,
.idcode2 = 0,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 16,
.name = "S25FL008A",
@@ -56,7 +54,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x0214,
.idcode2 = 0,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 32,
.name = "S25FL016A",
@@ -64,7 +61,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x0215,
.idcode2 = 0,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 64,
.name = "S25FL032A",
@@ -72,7 +68,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x0216,
.idcode2 = 0,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 128,
.name = "S25FL064A",
@@ -80,7 +75,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x2018,
.idcode2 = 0x0301,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 256,
.name = "S25FL128P_64K",
@@ -88,7 +82,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x2018,
.idcode2 = 0x0300,
- .page_size = 256,
.pages_per_sector = 1024,
.nr_sectors = 64,
.name = "S25FL128P_256K",
@@ -96,7 +89,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x0215,
.idcode2 = 0x4d00,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 64,
.name = "S25FL032P",
@@ -104,7 +96,6 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = {
{
.idcode1 = 0x2018,
.idcode2 = 0x4d01,
- .page_size = 256,
.pages_per_sector = 256,
.nr_sectors = 256,
.name = "S25FL129P_64K",
@@ -151,8 +142,8 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
flash->write = spi_flash_cmd_write_multi;
flash->erase = spansion_erase;
flash->read = spi_flash_cmd_read_fast;
- flash->page_size = params->page_size;
- flash->sector_size = params->page_size * params->pages_per_sector;
+ flash->page_size = 256;
+ flash->sector_size = 256 * params->pages_per_sector;
flash->size = flash->sector_size * params->nr_sectors;
return flash;