mtd: nand: make use of mtd_to_nand() in NAND core code
mtd_to_nand() was recently introduced to avoid direct access to the mtd->priv field. Update core code to use mtd_to_nand(). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:

committed by
Brian Norris

parent
7326ffef78
commit
862eba519e
@@ -424,7 +424,7 @@ int nand_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf,
|
||||
unsigned char *code)
|
||||
{
|
||||
__nand_calculate_ecc(buf,
|
||||
((struct nand_chip *)mtd->priv)->ecc.size, code);
|
||||
mtd_to_nand(mtd)->ecc.size, code);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -524,7 +524,7 @@ int nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
|
||||
unsigned char *read_ecc, unsigned char *calc_ecc)
|
||||
{
|
||||
return __nand_correct_data(buf, read_ecc, calc_ecc,
|
||||
((struct nand_chip *)mtd->priv)->ecc.size);
|
||||
mtd_to_nand(mtd)->ecc.size);
|
||||
}
|
||||
EXPORT_SYMBOL(nand_correct_data);
|
||||
|
||||
|
Reference in New Issue
Block a user