summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-12-16 12:05:25 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-12-16 21:28:41 +0100
commite3f45226bdb7a12067df93a0b2b0e1705d80cbbe (patch)
tree05163d76bc9c7c19bbcb9f690ef73c0fb029b434
parentdac6dbc0139674c70b3c004600578c6b0f82fc21 (diff)
downloadrockbox-e3f45226bdb7a12067df93a0b2b0e1705d80cbbe.tar.gz
rockbox-e3f45226bdb7a12067df93a0b2b0e1705d80cbbe.zip
imx233: simplify sdmmc led handling, fix typo
Change-Id: Iffbb05afd41bd0accfac9c127ea3a26fd33f1387
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index 32d0013574..17b37821b2 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -502,13 +502,6 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf,
502 return ret; 502 return ret;
503} 503}
504 504
505static void do_led(int delta)
506{
507 static int level = 0;
508 level += delta;
509 led(level > 0);
510}
511
512static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) 505static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read)
513{ 506{
514 int ret = 0; 507 int ret = 0;
@@ -520,7 +513,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
520 mutex_lock(&mutex[drive]); 513 mutex_lock(&mutex[drive]);
521 514
522 /* update led status */ 515 /* update led status */
523 do_led(1); 516 led(true);
524 517
525 /* for SD cards, init if necessary */ 518 /* for SD cards, init if necessary */
526#if CONFIG_STORAGE & STORAGE_SD 519#if CONFIG_STORAGE & STORAGE_SD
@@ -553,7 +546,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
553 goto Ldeselect; 546 goto Ldeselect;
554 547
555 /** 548 /**
556 * NOTE: we need to make sure dma transfers are aligned. This handled 549 * NOTE: we need to make sure dma transfers are aligned. This is handled
557 * differently for read and write transfers. We do not repeat it each 550 * differently for read and write transfers. We do not repeat it each
558 * time but it should be noted that all transfers are limited by 551 * time but it should be noted that all transfers are limited by
559 * IMX233_MAX_SINGLE_DMA_XFER_SIZE and thus need to be split if needed. 552 * IMX233_MAX_SINGLE_DMA_XFER_SIZE and thus need to be split if needed.
@@ -616,7 +609,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
616 ret = -23; 609 ret = -23;
617 Lend: 610 Lend:
618 /* update led status */ 611 /* update led status */
619 do_led(-1); 612 led(false);
620 /* release per-drive mutex */ 613 /* release per-drive mutex */
621 mutex_unlock(&mutex[drive]); 614 mutex_unlock(&mutex[drive]);
622 return ret; 615 return ret;