diff options
Diffstat (limited to 'drivers/mtd/nand/jz4740_nand.c')
-rw-r--r-- | drivers/mtd/nand/jz4740_nand.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c index b76460eeaf22..a264b888c66c 100644 --- a/drivers/mtd/nand/jz4740_nand.c +++ b/drivers/mtd/nand/jz4740_nand.c | |||
@@ -411,7 +411,7 @@ static int jz_nand_probe(struct platform_device *pdev) | |||
411 | struct jz_nand *nand; | 411 | struct jz_nand *nand; |
412 | struct nand_chip *chip; | 412 | struct nand_chip *chip; |
413 | struct mtd_info *mtd; | 413 | struct mtd_info *mtd; |
414 | struct jz_nand_platform_data *pdata = pdev->dev.platform_data; | 414 | struct jz_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); |
415 | size_t chipnr, bank_idx; | 415 | size_t chipnr, bank_idx; |
416 | uint8_t nand_maf_id = 0, nand_dev_id = 0; | 416 | uint8_t nand_maf_id = 0, nand_dev_id = 0; |
417 | 417 | ||
@@ -538,7 +538,6 @@ err_unclaim_banks: | |||
538 | err_gpio_busy: | 538 | err_gpio_busy: |
539 | if (pdata && gpio_is_valid(pdata->busy_gpio)) | 539 | if (pdata && gpio_is_valid(pdata->busy_gpio)) |
540 | gpio_free(pdata->busy_gpio); | 540 | gpio_free(pdata->busy_gpio); |
541 | platform_set_drvdata(pdev, NULL); | ||
542 | err_iounmap_mmio: | 541 | err_iounmap_mmio: |
543 | jz_nand_iounmap_resource(nand->mem, nand->base); | 542 | jz_nand_iounmap_resource(nand->mem, nand->base); |
544 | err_free: | 543 | err_free: |
@@ -549,7 +548,7 @@ err_free: | |||
549 | static int jz_nand_remove(struct platform_device *pdev) | 548 | static int jz_nand_remove(struct platform_device *pdev) |
550 | { | 549 | { |
551 | struct jz_nand *nand = platform_get_drvdata(pdev); | 550 | struct jz_nand *nand = platform_get_drvdata(pdev); |
552 | struct jz_nand_platform_data *pdata = pdev->dev.platform_data; | 551 | struct jz_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); |
553 | size_t i; | 552 | size_t i; |
554 | 553 | ||
555 | nand_release(&nand->mtd); | 554 | nand_release(&nand->mtd); |
@@ -570,7 +569,6 @@ static int jz_nand_remove(struct platform_device *pdev) | |||
570 | 569 | ||
571 | jz_nand_iounmap_resource(nand->mem, nand->base); | 570 | jz_nand_iounmap_resource(nand->mem, nand->base); |
572 | 571 | ||
573 | platform_set_drvdata(pdev, NULL); | ||
574 | kfree(nand); | 572 | kfree(nand); |
575 | 573 | ||
576 | return 0; | 574 | return 0; |