aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebastian.rasmussen@stericsson.com>2011-03-11 02:21:49 +0100
committerLinus WALLEIJ <linus.walleij@stericsson.com>2011-03-22 11:44:30 +0100
commit32485aeff8b84e82f9be590226ad11ce3c4b938c (patch)
treecb867aa89eefc2ea281500ec8ccba404f1d949fb /drivers/mmc
parentbeadf1d76d2590e2c2414c32492d651152389737 (diff)
MMCI: Cleanup of driver
Make driver pass checkpatch cleanly. Signed-off-by: Sebastian Rasmussen <sebastian.rasmussen@stericsson.com> Change-Id: I804c457f7a0d5846e6735c304b208d4c4d746a3d Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18119 Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c42
-rw-r--r--drivers/mmc/host/mmci.h6
2 files changed, 29 insertions, 19 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 63a80438b16..e9e2619fec7 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -29,7 +29,7 @@
#include <linux/dma-mapping.h>
#include <linux/amba/mmci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/sizes.h>
#ifdef CONFIG_ARCH_U8500
@@ -467,7 +467,8 @@ static int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl)
/* Check for weird stuff in the sg list */
for_each_sg(data->sg, sg, data->sg_len, i) {
- dev_vdbg(mmc_dev(host->mmc), "MMCI SGlist %d dir %d: length: %08x\n",
+ dev_vdbg(mmc_dev(host->mmc),
+ "MMCI SGlist %d dir %d: length: %08x\n",
i, direction, sg->length);
if (sg->offset & 3 || sg->length & 3)
return -EINVAL;
@@ -537,7 +538,8 @@ static inline void mmci_dma_terminate(struct mmci_host *host)
{
}
-static inline int mmci_dma_start_data(struct mmci_host *host, unsigned int datactrl)
+static inline int mmci_dma_start_data(struct mmci_host *host,
+ unsigned int datactrl)
{
return -ENOSYS;
}
@@ -691,8 +693,9 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
struct variant_data *variant = host->variant;
/* First check for errors */
- if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
- dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status);
+ if (status & MCI_DATA_ERR) {
+ dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n",
+ status);
if (status & MCI_DATACRCFAIL)
data->error = -EILSEQ;
else if (status & MCI_DATATIMEOUT)
@@ -783,11 +786,10 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
cmd->resp[2] = readl(base + MMCIRESPONSE2);
cmd->resp[3] = readl(base + MMCIRESPONSE3);
- if (status & MCI_CMDTIMEOUT) {
+ if (status & MCI_CMDTIMEOUT)
cmd->error = -ETIMEDOUT;
- } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) {
+ else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC)
cmd->error = -EILSEQ;
- }
if (!cmd->data || cmd->error) {
if (host->data) {
@@ -796,12 +798,12 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
mmci_stop_data(host);
}
mmci_request_end(host, cmd->mrq);
- } else if (!(cmd->data->flags & MMC_DATA_READ)) {
+ } else if (!(cmd->data->flags & MMC_DATA_READ))
mmci_start_data(host, cmd->data);
- }
}
-static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int remain)
+static int mmci_pio_read(struct mmci_host *host, char *buffer,
+ unsigned int remain)
{
void __iomem *base = host->base;
char *ptr = buffer;
@@ -849,7 +851,8 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
return ptr - buffer;
}
-static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int remain, u32 status)
+static int mmci_pio_write(struct mmci_host *host, char *buffer,
+ unsigned int remain, u32 status)
{
struct variant_data *variant = host->variant;
void __iomem *base = host->base;
@@ -1066,12 +1069,11 @@ static irqreturn_t mmci_irq(int irq, void *dev_id)
mmc_signal_sdio_irq(host->mmc);
data = host->data;
- if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|
- MCI_RXOVERRUN|MCI_DATAEND|MCI_DATABLOCKEND) && data)
+ if (status & MCI_DATA_IRQ && data)
mmci_data_irq(host, data, status);
cmd = host->cmd;
- if (status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT|MCI_CMDSENT|MCI_CMDRESPEND) && cmd)
+ if (status & MCI_CMD_IRQ && cmd)
mmci_cmd_irq(host, cmd, status);
ret = 1;
@@ -1591,7 +1593,8 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
mmci_setup_dma(host);
- ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host);
+ ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED,
+ DRIVER_NAME " (cmd)", host);
if (ret)
goto unmap;
@@ -1610,9 +1613,10 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
mmc_add_host(mmc);
- dev_info(&dev->dev, "%s: MMCI/PL180 manf %x rev %x cfg %02x at 0x%016llx\n",
- mmc_hostname(mmc), amba_manf(dev), amba_rev(dev), amba_config(dev),
- (unsigned long long)dev->res.start);
+ dev_info(&dev->dev,
+ "%s: MMCI/PL180 manf %x rev %x cfg %02x at 0x%016llx\n",
+ mmc_hostname(mmc), amba_manf(dev), amba_rev(dev),
+ amba_config(dev), (unsigned long long)dev->res.start);
dev_info(&dev->dev, "IRQ %d, %d (pio)\n", dev->irq[0], dev->irq[1]);
/* Disable clock and set disable delay if supported */
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index 61b871a8a5a..73e9cff3333 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -141,6 +141,12 @@
MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \
MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK)
+#define MCI_DATA_ERR \
+ (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)
+#define MCI_DATA_IRQ (MCI_DATA_ERR|MCI_DATAEND|MCI_DATABLOCKEND)
+#define MCI_CMD_ERR (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT)
+#define MCI_CMD_IRQ (MCI_CMD_ERR|MCI_CMDRESPEND|MCI_CMDSENT)
+
/* These interrupts are directed to IRQ1 when two IRQ lines are available */
#define MCI_IRQ1MASK \
(MCI_RXFIFOHALFFULLMASK | MCI_RXDATAAVLBLMASK | \