aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm53xx
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-11-26 11:43:16 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-11-26 11:43:16 +0000
commitfb02c572a958291258b393956d40fed550902b68 (patch)
treea1e859c6c69cddbc2c14a3f6185e7ae84c9df266 /target/linux/bcm53xx
parent0deb9572b471ab88109e1153e08838d0eb30c698 (diff)
downloadmaster-187ad058-fb02c572a958291258b393956d40fed550902b68.tar.gz
master-187ad058-fb02c572a958291258b393956d40fed550902b68.tar.bz2
master-187ad058-fb02c572a958291258b393956d40fed550902b68.zip
bcm53xx: update bcm53xxspiflash to match spi-nor backported from 4.4-rc1
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47653 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/bcm53xx')
-rw-r--r--target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c b/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c
index 954b9c5527..438fd498fc 100644
--- a/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c
+++ b/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c
@@ -10,7 +10,6 @@ static const char * const probes[] = { "ofpart", "bcm47xxpart", NULL };
struct bcm53xxsf {
struct spi_device *spi;
- struct mtd_info mtd;
struct spi_nor nor;
};
@@ -27,7 +26,7 @@ static int bcm53xxspiflash_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf,
}
static int bcm53xxspiflash_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf,
- int len, int write_enable)
+ int len)
{
struct bcm53xxsf *b53sf = nor->priv;
u8 *cmd = kzalloc(len + 1, GFP_KERNEL);
@@ -58,7 +57,7 @@ static int bcm53xxspiflash_read(struct spi_nor *nor, loff_t from, size_t len,
spi_message_init(&m);
cmd[cmd_len++] = SPINOR_OP_READ;
- if (b53sf->mtd.size > 0x1000000)
+ if (nor->mtd.size > 0x1000000)
cmd[cmd_len++] = (from & 0xFF000000) >> 24;
cmd[cmd_len++] = (from & 0x00FF0000) >> 16;
cmd[cmd_len++] = (from & 0x0000FF00) >> 8;
@@ -98,7 +97,7 @@ static void bcm53xxspiflash_write(struct spi_nor *nor, loff_t to, size_t len,
spi_message_init(&m);
cmd[cmd_len++] = nor->program_opcode;
- if (b53sf->mtd.size > 0x1000000)
+ if (nor->mtd.size > 0x1000000)
cmd[cmd_len++] = (to & 0xFF000000) >> 24;
cmd[cmd_len++] = (to & 0x00FF0000) >> 16;
cmd[cmd_len++] = (to & 0x0000FF00) >> 8;
@@ -128,7 +127,7 @@ static int bcm53xxspiflash_erase(struct spi_nor *nor, loff_t offs)
i = 0;
cmd[i++] = nor->erase_opcode;
- if (b53sf->mtd.size > 0x1000000)
+ if (nor->mtd.size > 0x1000000)
cmd[i++] = (offs & 0xFF000000) >> 24;
cmd[i++] = ((offs & 0x00FF0000) >> 16);
cmd[i++] = ((offs & 0x0000FF00) >> 8);
@@ -189,9 +188,7 @@ static int bcm53xxspiflash_probe(struct spi_device *spi)
nor = &b53sf->nor;
b53sf->spi = spi;
- b53sf->mtd.priv = &b53sf->nor;
- nor->mtd = &b53sf->mtd;
nor->dev = &spi->dev;
nor->read_reg = bcm53xxspiflash_read_reg;
nor->write_reg = bcm53xxspiflash_write_reg;
@@ -206,7 +203,7 @@ static int bcm53xxspiflash_probe(struct spi_device *spi)
return err;
parser_data.of_node = spi->master->dev.parent->of_node;
- err = mtd_device_parse_register(&b53sf->mtd, probes, &parser_data,
+ err = mtd_device_parse_register(&nor->mtd, probes, &parser_data,
NULL, 0);
if (err)
return err;