mtd: nand: make use of nand_set/get_controller_data() helpers
[deliverable/linux.git] / drivers / mtd / nand / lpc32xx_slc.c
index ccd10b182a220db17f9f1032ad775e8edbe8e17f..3b8f3735f3e86324f36b0bd4484aab2cda571fb9 100644 (file)
@@ -260,7 +260,7 @@ static void lpc32xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
 {
        uint32_t tmp;
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
 
        /* Does CE state need to be changed? */
        tmp = readl(SLC_CFG(host->io_base));
@@ -284,7 +284,7 @@ static void lpc32xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
 static int lpc32xx_nand_device_ready(struct mtd_info *mtd)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
        int rdy = 0;
 
        if ((readl(SLC_STAT(host->io_base)) & SLCSTAT_NAND_READY) != 0)
@@ -339,7 +339,7 @@ static int lpc32xx_nand_ecc_calculate(struct mtd_info *mtd,
 static uint8_t lpc32xx_nand_read_byte(struct mtd_info *mtd)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
 
        return (uint8_t)readl(SLC_DATA(host->io_base));
 }
@@ -350,7 +350,7 @@ static uint8_t lpc32xx_nand_read_byte(struct mtd_info *mtd)
 static void lpc32xx_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
 
        /* Direct device read with no ECC */
        while (len-- > 0)
@@ -363,7 +363,7 @@ static void lpc32xx_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 static void lpc32xx_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
 
        /* Direct device write with no ECC */
        while (len-- > 0)
@@ -428,7 +428,7 @@ static int lpc32xx_xmit_dma(struct mtd_info *mtd, dma_addr_t dma,
                            void *mem, int len, enum dma_transfer_direction dir)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
        struct dma_async_tx_descriptor *desc;
        int flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
        int res;
@@ -488,7 +488,7 @@ static int lpc32xx_xfer(struct mtd_info *mtd, uint8_t *buf, int eccsubpages,
                        int read)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
        int i, status = 0;
        unsigned long timeout;
        int res;
@@ -603,7 +603,7 @@ static int lpc32xx_nand_read_page_syndrome(struct mtd_info *mtd,
                                           struct nand_chip *chip, uint8_t *buf,
                                           int oob_required, int page)
 {
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
        int stat, i, status;
        uint8_t *oobecc, tmpecc[LPC32XX_ECC_SAVE_SIZE];
 
@@ -665,7 +665,7 @@ static int lpc32xx_nand_write_page_syndrome(struct mtd_info *mtd,
                                            const uint8_t *buf,
                                            int oob_required, int page)
 {
-       struct lpc32xx_nand_host *host = chip->priv;
+       struct lpc32xx_nand_host *host = nand_get_controller_data(chip);
        uint8_t *pb = chip->oob_poi + chip->ecc.layout->eccpos[0];
        int error;
 
@@ -800,7 +800,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 
        chip = &host->nand_chip;
        mtd = nand_to_mtd(chip);
-       chip->priv = host;
+       nand_set_controller_data(chip, host);
        nand_set_flash_node(chip, pdev->dev.of_node);
        mtd->owner = THIS_MODULE;
        mtd->dev.parent = &pdev->dev;
This page took 0.025701 seconds and 5 git commands to generate.