diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-12-10 02:59:55 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-12-18 13:25:07 -0500 |
commit | e787dfd1be424e0546d05d6819c8ab9c222ec248 (patch) | |
tree | 12ab3e9a58d35bab470d381f0007ab0885746c14 /drivers/mtd/nand/cafe_nand.c | |
parent | f1c4c9992b1f088ab42ff9fa483ad9eed411e421 (diff) |
mtd: nand: cafe: use the mtd instance embedded in struct nand_chip
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>
Diffstat (limited to 'drivers/mtd/nand/cafe_nand.c')
-rw-r--r-- | drivers/mtd/nand/cafe_nand.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index 77c92f1b985f..7d6a14218bef 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c | |||
@@ -605,11 +605,11 @@ static int cafe_nand_probe(struct pci_dev *pdev, | |||
605 | 605 | ||
606 | pci_set_master(pdev); | 606 | pci_set_master(pdev); |
607 | 607 | ||
608 | mtd = kzalloc(sizeof(*mtd) + sizeof(struct cafe_priv), GFP_KERNEL); | 608 | cafe = kzalloc(sizeof(*cafe), GFP_KERNEL); |
609 | if (!mtd) | 609 | if (!cafe) |
610 | return -ENOMEM; | 610 | return -ENOMEM; |
611 | cafe = (void *)(&mtd[1]); | ||
612 | 611 | ||
612 | mtd = nand_to_mtd(&cafe->nand); | ||
613 | mtd->dev.parent = &pdev->dev; | 613 | mtd->dev.parent = &pdev->dev; |
614 | mtd->priv = &cafe->nand; | 614 | mtd->priv = &cafe->nand; |
615 | cafe->nand.priv = cafe; | 615 | cafe->nand.priv = cafe; |
@@ -792,7 +792,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, | |||
792 | out_ior: | 792 | out_ior: |
793 | pci_iounmap(pdev, cafe->mmio); | 793 | pci_iounmap(pdev, cafe->mmio); |
794 | out_free_mtd: | 794 | out_free_mtd: |
795 | kfree(mtd); | 795 | kfree(cafe); |
796 | out: | 796 | out: |
797 | return err; | 797 | return err; |
798 | } | 798 | } |
@@ -813,7 +813,7 @@ static void cafe_nand_remove(struct pci_dev *pdev) | |||
813 | 2112 + sizeof(struct nand_buffers) + | 813 | 2112 + sizeof(struct nand_buffers) + |
814 | mtd->writesize + mtd->oobsize, | 814 | mtd->writesize + mtd->oobsize, |
815 | cafe->dmabuf, cafe->dmaaddr); | 815 | cafe->dmabuf, cafe->dmaaddr); |
816 | kfree(mtd); | 816 | kfree(cafe); |
817 | } | 817 | } |
818 | 818 | ||
819 | static const struct pci_device_id cafe_nand_tbl[] = { | 819 | static const struct pci_device_id cafe_nand_tbl[] = { |