diff options
-rw-r--r-- | drivers/mtd/nand/pxa3xx_nand.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 61e1ff5a9ada..e55d7f8df978 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -359,7 +359,7 @@ static void handle_data_pio(struct pxa3xx_nand_info *info) | |||
359 | DIV_ROUND_UP(info->oob_size, 4)); | 359 | DIV_ROUND_UP(info->oob_size, 4)); |
360 | break; | 360 | break; |
361 | default: | 361 | default: |
362 | printk(KERN_ERR "%s: invalid state %d\n", __func__, | 362 | dev_err(&info->pdev->dev, "%s: invalid state %d\n", __func__, |
363 | info->state); | 363 | info->state); |
364 | BUG(); | 364 | BUG(); |
365 | } | 365 | } |
@@ -385,7 +385,7 @@ static void start_data_dma(struct pxa3xx_nand_info *info) | |||
385 | desc->dcmd |= DCMD_INCTRGADDR | DCMD_FLOWSRC; | 385 | desc->dcmd |= DCMD_INCTRGADDR | DCMD_FLOWSRC; |
386 | break; | 386 | break; |
387 | default: | 387 | default: |
388 | printk(KERN_ERR "%s: invalid state %d\n", __func__, | 388 | dev_err(&info->pdev->dev, "%s: invalid state %d\n", __func__, |
389 | info->state); | 389 | info->state); |
390 | BUG(); | 390 | BUG(); |
391 | } | 391 | } |
@@ -616,8 +616,8 @@ static int prepare_command_pool(struct pxa3xx_nand_info *info, int command, | |||
616 | 616 | ||
617 | default: | 617 | default: |
618 | exec_cmd = 0; | 618 | exec_cmd = 0; |
619 | printk(KERN_ERR "pxa3xx-nand: non-supported" | 619 | dev_err(&info->pdev->dev, "non-supported command %x\n", |
620 | " command %x\n", command); | 620 | command); |
621 | break; | 621 | break; |
622 | } | 622 | } |
623 | 623 | ||
@@ -646,7 +646,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info *mtd, unsigned command, | |||
646 | ret = wait_for_completion_timeout(&info->cmd_complete, | 646 | ret = wait_for_completion_timeout(&info->cmd_complete, |
647 | CHIP_DELAY_TIMEOUT); | 647 | CHIP_DELAY_TIMEOUT); |
648 | if (!ret) { | 648 | if (!ret) { |
649 | printk(KERN_ERR "Wait time out!!!\n"); | 649 | dev_err(&info->pdev->dev, "Wait time out!!!\n"); |
650 | /* Stop State Machine for next command cycle */ | 650 | /* Stop State Machine for next command cycle */ |
651 | pxa3xx_nand_stop(info); | 651 | pxa3xx_nand_stop(info); |
652 | } | 652 | } |
@@ -774,11 +774,15 @@ static int pxa3xx_nand_config_flash(struct pxa3xx_nand_info *info, | |||
774 | struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data; | 774 | struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data; |
775 | uint32_t ndcr = 0x0; /* enable all interrupts */ | 775 | uint32_t ndcr = 0x0; /* enable all interrupts */ |
776 | 776 | ||
777 | if (f->page_size != 2048 && f->page_size != 512) | 777 | if (f->page_size != 2048 && f->page_size != 512) { |
778 | dev_err(&pdev->dev, "Current only support 2048 and 512 size\n"); | ||
778 | return -EINVAL; | 779 | return -EINVAL; |
780 | } | ||
779 | 781 | ||
780 | if (f->flash_width != 16 && f->flash_width != 8) | 782 | if (f->flash_width != 16 && f->flash_width != 8) { |
783 | dev_err(&pdev->dev, "Only support 8bit and 16 bit!\n"); | ||
781 | return -EINVAL; | 784 | return -EINVAL; |
785 | } | ||
782 | 786 | ||
783 | /* calculate flash information */ | 787 | /* calculate flash information */ |
784 | info->cmdset = &default_cmdset; | 788 | info->cmdset = &default_cmdset; |
@@ -898,7 +902,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd) | |||
898 | if (!ret) { | 902 | if (!ret) { |
899 | kfree(mtd); | 903 | kfree(mtd); |
900 | info->mtd = NULL; | 904 | info->mtd = NULL; |
901 | printk(KERN_INFO "There is no nand chip on cs 0!\n"); | 905 | dev_info(&info->pdev->dev, "There is no nand chip on cs 0!\n"); |
902 | 906 | ||
903 | return -EINVAL; | 907 | return -EINVAL; |
904 | } | 908 | } |
@@ -906,11 +910,12 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd) | |||
906 | chip->cmdfunc(mtd, NAND_CMD_READID, 0, 0); | 910 | chip->cmdfunc(mtd, NAND_CMD_READID, 0, 0); |
907 | id = *((uint16_t *)(info->data_buff)); | 911 | id = *((uint16_t *)(info->data_buff)); |
908 | if (id != 0) | 912 | if (id != 0) |
909 | printk(KERN_INFO "Detect a flash id %x\n", id); | 913 | dev_info(&info->pdev->dev, "Detect a flash id %x\n", id); |
910 | else { | 914 | else { |
911 | kfree(mtd); | 915 | kfree(mtd); |
912 | info->mtd = NULL; | 916 | info->mtd = NULL; |
913 | printk(KERN_WARNING "Read out ID 0, potential timing set wrong!!\n"); | 917 | dev_warn(&info->pdev->dev, |
918 | "Read out ID 0, potential timing set wrong!!\n"); | ||
914 | 919 | ||
915 | return -EINVAL; | 920 | return -EINVAL; |
916 | } | 921 | } |
@@ -930,7 +935,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd) | |||
930 | if (i >= (ARRAY_SIZE(builtin_flash_types) + pdata->num_flash - 1)) { | 935 | if (i >= (ARRAY_SIZE(builtin_flash_types) + pdata->num_flash - 1)) { |
931 | kfree(mtd); | 936 | kfree(mtd); |
932 | info->mtd = NULL; | 937 | info->mtd = NULL; |
933 | printk(KERN_ERR "ERROR!! flash not defined!!!\n"); | 938 | dev_err(&info->pdev->dev, "ERROR!! flash not defined!!!\n"); |
934 | 939 | ||
935 | return -EINVAL; | 940 | return -EINVAL; |
936 | } | 941 | } |