struct bcm53xxsf {
struct spi_device *spi;
- struct mtd_info mtd;
struct spi_nor nor;
};
}
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);
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;
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;
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);
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;
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;