summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_bch.c
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2015-12-01 12:03:03 +0100
committerBrian Norris <computersforpeace@gmail.com>2015-12-08 10:46:14 -0800
commit862eba519e79c48fb6ee276081ddb98fe6926f02 (patch)
tree95b7adf71c1b1f44f0c56cebf8a19d6602cf886c /drivers/mtd/nand/nand_bch.c
parent7326ffef788dd5823c820a6ac5b5e864e8a486a0 (diff)
downloadlinux-862eba519e79c48fb6ee276081ddb98fe6926f02.tar.gz
linux-862eba519e79c48fb6ee276081ddb98fe6926f02.tar.bz2
linux-862eba519e79c48fb6ee276081ddb98fe6926f02.zip
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>
Diffstat (limited to 'drivers/mtd/nand/nand_bch.c')
-rw-r--r--drivers/mtd/nand/nand_bch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/nand/nand_bch.c
index 3803e0bba23b..e5758d885943 100644
--- a/drivers/mtd/nand/nand_bch.c
+++ b/drivers/mtd/nand/nand_bch.c
@@ -52,7 +52,7 @@ struct nand_bch_control {
int nand_bch_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf,
unsigned char *code)
{
- const struct nand_chip *chip = mtd->priv;
+ const struct nand_chip *chip = mtd_to_nand(mtd);
struct nand_bch_control *nbc = chip->ecc.priv;
unsigned int i;
@@ -79,7 +79,7 @@ EXPORT_SYMBOL(nand_bch_calculate_ecc);
int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf,
unsigned char *read_ecc, unsigned char *calc_ecc)
{
- const struct nand_chip *chip = mtd->priv;
+ const struct nand_chip *chip = mtd_to_nand(mtd);
struct nand_bch_control *nbc = chip->ecc.priv;
unsigned int *errloc = nbc->errloc;
int i, count;