Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Boris BREZILLON and committed by
Brian Norris
f07dcb90 d699ed25

+5 -5
+5 -5
drivers/staging/mt29f_spinand/mt29f_spinand.c
··· 32 32 static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) 33 33 { 34 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 36 struct spinand_state *state = (struct spinand_state *)info->priv; 37 37 38 38 return state; ··· 633 633 u8 *p = buf; 634 634 int eccsize = chip->ecc.size; 635 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 638 enable_read_hw_ecc = 1; 639 639 ··· 679 679 680 680 static 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 684 unsigned long timeo = jiffies; 685 685 int retval, state = chip->state; ··· 745 745 int column, int page) 746 746 { 747 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 749 struct spinand_state *state = (struct spinand_state *)info->priv; 750 750 751 751 switch (command) { ··· 894 894 #endif 895 895 896 896 nand_set_flash_node(chip, spi_nand->dev.of_node); 897 - chip->priv = info; 897 + nand_set_controller_data(chip, info); 898 898 chip->read_buf = spinand_read_buf; 899 899 chip->write_buf = spinand_write_buf; 900 900 chip->read_byte = spinand_read_byte;