mtd: nand: hisi504: 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>
This commit is contained in:
parent
2a690b25f6
commit
fa100163d3
|
@ -134,7 +134,6 @@
|
||||||
|
|
||||||
struct hinfc_host {
|
struct hinfc_host {
|
||||||
struct nand_chip chip;
|
struct nand_chip chip;
|
||||||
struct mtd_info mtd;
|
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
void __iomem *iobase;
|
void __iomem *iobase;
|
||||||
void __iomem *mmio;
|
void __iomem *mmio;
|
||||||
|
@ -189,8 +188,8 @@ static void wait_controller_finished(struct hinfc_host *host)
|
||||||
|
|
||||||
static void hisi_nfc_dma_transfer(struct hinfc_host *host, int todev)
|
static void hisi_nfc_dma_transfer(struct hinfc_host *host, int todev)
|
||||||
{
|
{
|
||||||
struct mtd_info *mtd = &host->mtd;
|
struct nand_chip *chip = &host->chip;
|
||||||
struct nand_chip *chip = mtd_to_nand(mtd);
|
struct mtd_info *mtd = nand_to_mtd(chip);
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -262,7 +261,7 @@ static int hisi_nfc_send_cmd_pageprog(struct hinfc_host *host)
|
||||||
|
|
||||||
static int hisi_nfc_send_cmd_readstart(struct hinfc_host *host)
|
static int hisi_nfc_send_cmd_readstart(struct hinfc_host *host)
|
||||||
{
|
{
|
||||||
struct mtd_info *mtd = &host->mtd;
|
struct mtd_info *mtd = nand_to_mtd(&host->chip);
|
||||||
|
|
||||||
if ((host->addr_value[0] == host->cache_addr_value[0]) &&
|
if ((host->addr_value[0] == host->cache_addr_value[0]) &&
|
||||||
(host->addr_value[1] == host->cache_addr_value[1]))
|
(host->addr_value[1] == host->cache_addr_value[1]))
|
||||||
|
@ -643,7 +642,7 @@ static int hisi_nfc_ecc_probe(struct hinfc_host *host)
|
||||||
int size, strength, ecc_bits;
|
int size, strength, ecc_bits;
|
||||||
struct device *dev = host->dev;
|
struct device *dev = host->dev;
|
||||||
struct nand_chip *chip = &host->chip;
|
struct nand_chip *chip = &host->chip;
|
||||||
struct mtd_info *mtd = &host->mtd;
|
struct mtd_info *mtd = nand_to_mtd(chip);
|
||||||
struct device_node *np = host->dev->of_node;
|
struct device_node *np = host->dev->of_node;
|
||||||
|
|
||||||
size = of_get_nand_ecc_step_size(np);
|
size = of_get_nand_ecc_step_size(np);
|
||||||
|
@ -712,7 +711,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
platform_set_drvdata(pdev, host);
|
platform_set_drvdata(pdev, host);
|
||||||
chip = &host->chip;
|
chip = &host->chip;
|
||||||
mtd = &host->mtd;
|
mtd = nand_to_mtd(chip);
|
||||||
|
|
||||||
irq = platform_get_irq(pdev, 0);
|
irq = platform_get_irq(pdev, 0);
|
||||||
if (irq < 0) {
|
if (irq < 0) {
|
||||||
|
@ -822,7 +821,7 @@ err_res:
|
||||||
static int hisi_nfc_remove(struct platform_device *pdev)
|
static int hisi_nfc_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct hinfc_host *host = platform_get_drvdata(pdev);
|
struct hinfc_host *host = platform_get_drvdata(pdev);
|
||||||
struct mtd_info *mtd = &host->mtd;
|
struct mtd_info *mtd = nand_to_mtd(&host->chip);
|
||||||
|
|
||||||
nand_release(mtd);
|
nand_release(mtd);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue