imx233: simplify sdmmc led handling, fix typo

Change-Id: Iffbb05afd41bd0accfac9c127ea3a26fd33f1387
This commit is contained in:
Amaury Pouly 2012-12-16 12:05:25 +01:00
parent dac6dbc013
commit e3f45226bd

View file

@ -502,13 +502,6 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf,
return ret;
}
static void do_led(int delta)
{
static int level = 0;
level += delta;
led(level > 0);
}
static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read)
{
int ret = 0;
@ -520,7 +513,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
mutex_lock(&mutex[drive]);
/* update led status */
do_led(1);
led(true);
/* for SD cards, init if necessary */
#if CONFIG_STORAGE & STORAGE_SD
@ -553,7 +546,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
goto Ldeselect;
/**
* NOTE: we need to make sure dma transfers are aligned. This handled
* NOTE: we need to make sure dma transfers are aligned. This is handled
* differently for read and write transfers. We do not repeat it each
* time but it should be noted that all transfers are limited by
* 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
ret = -23;
Lend:
/* update led status */
do_led(-1);
led(false);
/* release per-drive mutex */
mutex_unlock(&mutex[drive]);
return ret;