Skip to content

Commit

Permalink
mtd: nand: socrates: use the mtd instance embedded in struct nand_chip
Browse files Browse the repository at this point in the history
struct nand_chip now embeds an mtd device. Make use of this mtd instance.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Boris BREZILLON authored and Brian Norris committed Dec 18, 2015
1 parent 17dd20b commit a723bf6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/mtd/nand/socrates_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

struct socrates_nand_host {
struct nand_chip nand_chip;
struct mtd_info mtd;
void __iomem *io_base;
struct device *dev;
};
Expand Down Expand Up @@ -159,8 +158,8 @@ static int socrates_nand_probe(struct platform_device *ofdev)
return -EIO;
}

mtd = &host->mtd;
nand_chip = &host->nand_chip;
mtd = nand_to_mtd(nand_chip);
host->dev = &ofdev->dev;

nand_chip->priv = host; /* link the private data structures */
Expand Down Expand Up @@ -216,7 +215,7 @@ static int socrates_nand_probe(struct platform_device *ofdev)
static int socrates_nand_remove(struct platform_device *ofdev)
{
struct socrates_nand_host *host = dev_get_drvdata(&ofdev->dev);
struct mtd_info *mtd = &host->mtd;
struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);

nand_release(mtd);

Expand Down

0 comments on commit a723bf6

Please sign in to comment.