aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2015-12-10 03:00:42 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-01-07 13:23:41 -0500
commitf07dcb90e4a9ccab9663a50847f255c9b0e2ada1 (patch)
treef24c1e3c859e86ea91dcb3536f8ca439433b647d
parentd699ed250c07384840263bbbf69cf7b90b45470c (diff)
staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers
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>
-rw-r--r--drivers/staging/mt29f_spinand/mt29f_spinand.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c
index b7d429d45dab..197d1124733d 100644
--- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
+++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
@@ -32,7 +32,7 @@
32static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) 32static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
33{ 33{
34 struct nand_chip *chip = mtd_to_nand(mtd); 34 struct nand_chip *chip = mtd_to_nand(mtd);
35 struct spinand_info *info = (struct spinand_info *)chip->priv; 35 struct spinand_info *info = nand_get_controller_data(chip);
36 struct spinand_state *state = (struct spinand_state *)info->priv; 36 struct spinand_state *state = (struct spinand_state *)info->priv;
37 37
38 return state; 38 return state;
@@ -633,7 +633,7 @@ static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
633 u8 *p = buf; 633 u8 *p = buf;
634 int eccsize = chip->ecc.size; 634 int eccsize = chip->ecc.size;
635 int eccsteps = chip->ecc.steps; 635 int eccsteps = chip->ecc.steps;
636 struct spinand_info *info = (struct spinand_info *)chip->priv; 636 struct spinand_info *info = nand_get_controller_data(chip);
637 637
638 enable_read_hw_ecc = 1; 638 enable_read_hw_ecc = 1;
639 639
@@ -679,7 +679,7 @@ static u8 spinand_read_byte(struct mtd_info *mtd)
679 679
680static int spinand_wait(struct mtd_info *mtd, struct nand_chip *chip) 680static int spinand_wait(struct mtd_info *mtd, struct nand_chip *chip)
681{ 681{
682 struct spinand_info *info = (struct spinand_info *)chip->priv; 682 struct spinand_info *info = nand_get_controller_data(chip);
683 683
684 unsigned long timeo = jiffies; 684 unsigned long timeo = jiffies;
685 int retval, state = chip->state; 685 int retval, state = chip->state;
@@ -745,7 +745,7 @@ static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
745 int column, int page) 745 int column, int page)
746{ 746{
747 struct nand_chip *chip = mtd_to_nand(mtd); 747 struct nand_chip *chip = mtd_to_nand(mtd);
748 struct spinand_info *info = (struct spinand_info *)chip->priv; 748 struct spinand_info *info = nand_get_controller_data(chip);
749 struct spinand_state *state = (struct spinand_state *)info->priv; 749 struct spinand_state *state = (struct spinand_state *)info->priv;
750 750
751 switch (command) { 751 switch (command) {
@@ -894,7 +894,7 @@ static int spinand_probe(struct spi_device *spi_nand)
894#endif 894#endif
895 895
896 nand_set_flash_node(chip, spi_nand->dev.of_node); 896 nand_set_flash_node(chip, spi_nand->dev.of_node);
897 chip->priv = info; 897 nand_set_controller_data(chip, info);
898 chip->read_buf = spinand_read_buf; 898 chip->read_buf = spinand_read_buf;
899 chip->write_buf = spinand_write_buf; 899 chip->write_buf = spinand_write_buf;
900 chip->read_byte = spinand_read_byte; 900 chip->read_byte = spinand_read_byte;