Commit b5a74d60 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

msm_sdcc.c: move overly indented code to separate function

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Brian Swetland <swetland@google.com>
Cc: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: San Mehat <san@android.com>
Cc: Matt Fleming <matt@console-pimps.org>
Cc: Ian Molton <ian@mnementh.co.uk>
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Cc: Philip Langdale <philipl@overt.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 75d14528
...@@ -584,30 +584,18 @@ static void msmsdcc_do_cmdirq(struct msmsdcc_host *host, uint32_t status) ...@@ -584,30 +584,18 @@ static void msmsdcc_do_cmdirq(struct msmsdcc_host *host, uint32_t status)
msmsdcc_start_data(host, cmd->data); msmsdcc_start_data(host, cmd->data);
} }
static irqreturn_t static void
msmsdcc_irq(int irq, void *dev_id) msmsdcc_handle_irq_data(struct msmsdcc_host *host, u32 status,
void __iomem *base)
{ {
struct msmsdcc_host *host = dev_id; struct mmc_data *data = host->curr.data;
void __iomem *base = host->base;
u32 status;
int ret = 0;
int cardint = 0;
spin_lock(&host->lock);
do { if (!data)
struct mmc_data *data; return;
status = readl(base + MMCISTATUS);
status &= (readl(base + MMCIMASK0) |
MCI_DATABLOCKENDMASK);
writel(status, base + MMCICLEAR);
data = host->curr.data;
if (data) {
/* Check for data errors */ /* Check for data errors */
if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT| if (status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT |
MCI_TXUNDERRUN|MCI_RXOVERRUN)) { MCI_TXUNDERRUN | MCI_RXOVERRUN)) {
msmsdcc_data_err(host, data, status); msmsdcc_data_err(host, data, status);
host->curr.data_xfered = 0; host->curr.data_xfered = 0;
if (host->dma.sg) if (host->dma.sg)
...@@ -616,12 +604,9 @@ msmsdcc_irq(int irq, void *dev_id) ...@@ -616,12 +604,9 @@ msmsdcc_irq(int irq, void *dev_id)
else { else {
msmsdcc_stop_data(host); msmsdcc_stop_data(host);
if (!data->stop) if (!data->stop)
msmsdcc_request_end(host, msmsdcc_request_end(host, data->mrq);
data->mrq);
else else
msmsdcc_start_command(host, msmsdcc_start_command(host, data->stop, 0);
data->stop,
0);
} }
} }
...@@ -629,46 +614,55 @@ msmsdcc_irq(int irq, void *dev_id) ...@@ -629,46 +614,55 @@ msmsdcc_irq(int irq, void *dev_id)
if (!host->curr.got_dataend && (status & MCI_DATAEND)) if (!host->curr.got_dataend && (status & MCI_DATAEND))
host->curr.got_dataend = 1; host->curr.got_dataend = 1;
if (!host->curr.got_datablkend && if (!host->curr.got_datablkend && (status & MCI_DATABLOCKEND))
(status & MCI_DATABLOCKEND)) {
host->curr.got_datablkend = 1; host->curr.got_datablkend = 1;
}
if (host->curr.got_dataend &&
host->curr.got_datablkend) {
/* /*
* If DMA is still in progress, we complete * If DMA is still in progress, we complete via the completion handler
* via the completion handler
*/ */
if (!host->dma.busy) { if (host->curr.got_dataend && host->curr.got_datablkend &&
!host->dma.busy) {
/* /*
* There appears to be an issue in the * There appears to be an issue in the controller where
* controller where if you request a * if you request a small block transfer (< fifo size),
* small block transfer (< fifo size), * you may get your DATAEND/DATABLKEND irq without the
* you may get your DATAEND/DATABLKEND * PIO data irq.
* irq without the PIO data irq.
* *
* Check to see if theres still data * Check to see if there is still data to be read,
* to be read, and simulate a PIO irq. * and simulate a PIO irq.
*/ */
if (readl(base + MMCISTATUS) & if (readl(base + MMCISTATUS) & MCI_RXDATAAVLBL)
MCI_RXDATAAVLBL)
msmsdcc_pio_irq(1, host); msmsdcc_pio_irq(1, host);
msmsdcc_stop_data(host); msmsdcc_stop_data(host);
if (!data->error) if (!data->error)
host->curr.data_xfered = host->curr.data_xfered = host->curr.xfer_size;
host->curr.xfer_size;
if (!data->stop) if (!data->stop)
msmsdcc_request_end(host, msmsdcc_request_end(host, data->mrq);
data->mrq);
else else
msmsdcc_start_command(host, msmsdcc_start_command(host, data->stop, 0);
data->stop, 0);
}
}
} }
}
static irqreturn_t
msmsdcc_irq(int irq, void *dev_id)
{
struct msmsdcc_host *host = dev_id;
void __iomem *base = host->base;
u32 status;
int ret = 0;
int cardint = 0;
spin_lock(&host->lock);
do {
status = readl(base + MMCISTATUS);
status &= (readl(base + MMCIMASK0) | MCI_DATABLOCKENDMASK);
writel(status, base + MMCICLEAR);
msmsdcc_handle_irq_data(host, status, base);
if (status & (MCI_CMDSENT | MCI_CMDRESPEND | MCI_CMDCRCFAIL | if (status & (MCI_CMDSENT | MCI_CMDRESPEND | MCI_CMDCRCFAIL |
MCI_CMDTIMEOUT) && host->curr.cmd) { MCI_CMDTIMEOUT) && host->curr.cmd) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment