diff options
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r-- | drivers/mtd/onenand/samsung.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index cb443af3d45f..a460f1b748c2 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c | |||
@@ -554,14 +554,13 @@ static int s5pc110_dma_ops(void *dst, void *src, size_t count, int direction) | |||
554 | 554 | ||
555 | do { | 555 | do { |
556 | status = readl(base + S5PC110_DMA_TRANS_STATUS); | 556 | status = readl(base + S5PC110_DMA_TRANS_STATUS); |
557 | if (status & S5PC110_DMA_TRANS_STATUS_TE) { | ||
558 | writel(S5PC110_DMA_TRANS_CMD_TEC, | ||
559 | base + S5PC110_DMA_TRANS_CMD); | ||
560 | return -EIO; | ||
561 | } | ||
557 | } while (!(status & S5PC110_DMA_TRANS_STATUS_TD)); | 562 | } while (!(status & S5PC110_DMA_TRANS_STATUS_TD)); |
558 | 563 | ||
559 | if (status & S5PC110_DMA_TRANS_STATUS_TE) { | ||
560 | writel(S5PC110_DMA_TRANS_CMD_TEC, base + S5PC110_DMA_TRANS_CMD); | ||
561 | writel(S5PC110_DMA_TRANS_CMD_TDC, base + S5PC110_DMA_TRANS_CMD); | ||
562 | return -EIO; | ||
563 | } | ||
564 | |||
565 | writel(S5PC110_DMA_TRANS_CMD_TDC, base + S5PC110_DMA_TRANS_CMD); | 564 | writel(S5PC110_DMA_TRANS_CMD_TDC, base + S5PC110_DMA_TRANS_CMD); |
566 | 565 | ||
567 | return 0; | 566 | return 0; |
@@ -571,13 +570,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, | |||
571 | unsigned char *buffer, int offset, size_t count) | 570 | unsigned char *buffer, int offset, size_t count) |
572 | { | 571 | { |
573 | struct onenand_chip *this = mtd->priv; | 572 | struct onenand_chip *this = mtd->priv; |
574 | void __iomem *bufferram; | ||
575 | void __iomem *p; | 573 | void __iomem *p; |
576 | void *buf = (void *) buffer; | 574 | void *buf = (void *) buffer; |
577 | dma_addr_t dma_src, dma_dst; | 575 | dma_addr_t dma_src, dma_dst; |
578 | int err; | 576 | int err; |
579 | 577 | ||
580 | p = bufferram = this->base + area; | 578 | p = this->base + area; |
581 | if (ONENAND_CURRENT_BUFFERRAM(this)) { | 579 | if (ONENAND_CURRENT_BUFFERRAM(this)) { |
582 | if (area == ONENAND_DATARAM) | 580 | if (area == ONENAND_DATARAM) |
583 | p += this->writesize; | 581 | p += this->writesize; |
@@ -621,7 +619,7 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, | |||
621 | normal: | 619 | normal: |
622 | if (count != mtd->writesize) { | 620 | if (count != mtd->writesize) { |
623 | /* Copy the bufferram to memory to prevent unaligned access */ | 621 | /* Copy the bufferram to memory to prevent unaligned access */ |
624 | memcpy(this->page_buf, bufferram, mtd->writesize); | 622 | memcpy(this->page_buf, p, mtd->writesize); |
625 | p = this->page_buf + offset; | 623 | p = this->page_buf + offset; |
626 | } | 624 | } |
627 | 625 | ||