Merge branch 'omap-for-v4.8/legacy' into for-next
[deliverable/linux.git] / drivers / mtd / nand / r852.c
index cb0bf09214d5cd29e6077917b2901c16e69b9de8..fc9287af4614039d305362b579112bc9d90cab0a 100644 (file)
@@ -65,7 +65,7 @@ static inline void r852_write_reg_dword(struct r852_device *dev,
 static inline struct r852_device *r852_get_dev(struct mtd_info *mtd)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       return chip->priv;
+       return nand_get_controller_data(chip);
 }
 
 
@@ -361,7 +361,7 @@ static void r852_cmdctl(struct mtd_info *mtd, int dat, unsigned int ctrl)
  */
 static int r852_wait(struct mtd_info *mtd, struct nand_chip *chip)
 {
-       struct r852_device *dev = chip->priv;
+       struct r852_device *dev = nand_get_controller_data(chip);
 
        unsigned long timeout;
        int status;
@@ -477,7 +477,7 @@ static int r852_ecc_correct(struct mtd_info *mtd, uint8_t *dat,
 
        if (dev->dma_error) {
                dev->dma_error = 0;
-               return -1;
+               return -EIO;
        }
 
        r852_write_reg(dev, R852_CTL, dev->ctlreg | R852_CTL_ECC_ACCESS);
@@ -491,7 +491,7 @@ static int r852_ecc_correct(struct mtd_info *mtd, uint8_t *dat,
                /* ecc uncorrectable error */
                if (ecc_status & R852_ECC_FAIL) {
                        dbg("ecc: unrecoverable error, in half %d", i);
-                       error = -1;
+                       error = -EBADMSG;
                        goto exit;
                }
 
@@ -879,7 +879,7 @@ static int  r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
        if (!dev)
                goto error5;
 
-       chip->priv = dev;
+       nand_set_controller_data(chip, dev);
        dev->chip = chip;
        dev->pci_dev = pci_dev;
        pci_set_drvdata(pci_dev, dev);
This page took 0.038385 seconds and 5 git commands to generate.