staging: mt29f_spinand: make use of mtd_to_nand()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:13 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a83dfa92850e521dfb6485ad4aa3c7c1fb52f06e
Commit:     a83dfa92850e521dfb6485ad4aa3c7c1fb52f06e
Parent:     862eba519e79c48fb6ee276081ddb98fe6926f02
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Tue Dec 1 12:03:05 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Dec 8 10:47:28 2015 -0800

    staging: mt29f_spinand: make use of mtd_to_nand()
    
    mtd_to_nand() was recently introduced to avoid direct accesses to the
    mtd->priv field. Use it where appropriate.
    
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c
index 6536066..8924a96 100644
--- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
+++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
@@ -31,7 +31,7 @@
 
 static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
 {
-	struct nand_chip *chip = (struct nand_chip *)mtd->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
 	struct spinand_info *info = (struct spinand_info *)chip->priv;
 	struct spinand_state *state = (struct spinand_state *)info->priv;
 
@@ -744,7 +744,7 @@ static void spinand_reset(struct spi_device *spi_nand)
 static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command,
 			    int column, int page)
 {
-	struct nand_chip *chip = (struct nand_chip *)mtd->priv;
+	struct nand_chip *chip = mtd_to_nand(mtd);
 	struct spinand_info *info = (struct spinand_info *)chip->priv;
 	struct spinand_state *state = (struct spinand_state *)info->priv;
 



More information about the linux-mtd-cvs mailing list