Skip to content

Commit

Permalink
staging: mt29f_spinand: make use of nand_set/get_controller_data() he…
Browse files Browse the repository at this point in the history
…lpers

New helpers have been added to avoid directly accessing chip->field. Use
them where appropriate.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Boris BREZILLON authored and Brian Norris committed Jan 7, 2016
1 parent d699ed2 commit f07dcb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/staging/mt29f_spinand/mt29f_spinand.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
{
struct nand_chip *chip = mtd_to_nand(mtd);
struct spinand_info *info = (struct spinand_info *)chip->priv;
struct spinand_info *info = nand_get_controller_data(chip);
struct spinand_state *state = (struct spinand_state *)info->priv;

return state;
Expand Down Expand Up @@ -633,7 +633,7 @@ static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
u8 *p = buf;
int eccsize = chip->ecc.size;
int eccsteps = chip->ecc.steps;
struct spinand_info *info = (struct spinand_info *)chip->priv;
struct spinand_info *info = nand_get_controller_data(chip);

enable_read_hw_ecc = 1;

Expand Down Expand Up @@ -679,7 +679,7 @@ static u8 spinand_read_byte(struct mtd_info *mtd)

static int spinand_wait(struct mtd_info *mtd, struct nand_chip *chip)
{
struct spinand_info *info = (struct spinand_info *)chip->priv;
struct spinand_info *info = nand_get_controller_data(chip);

unsigned long timeo = jiffies;
int retval, state = chip->state;
Expand Down Expand Up @@ -745,7 +745,7 @@ static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
int column, int page)
{
struct nand_chip *chip = mtd_to_nand(mtd);
struct spinand_info *info = (struct spinand_info *)chip->priv;
struct spinand_info *info = nand_get_controller_data(chip);
struct spinand_state *state = (struct spinand_state *)info->priv;

switch (command) {
Expand Down Expand Up @@ -894,7 +894,7 @@ static int spinand_probe(struct spi_device *spi_nand)
#endif

nand_set_flash_node(chip, spi_nand->dev.of_node);
chip->priv = info;
nand_set_controller_data(chip, info);
chip->read_buf = spinand_read_buf;
chip->write_buf = spinand_write_buf;
chip->read_byte = spinand_read_byte;
Expand Down

0 comments on commit f07dcb9

Please sign in to comment.