msm_sdcc.c: stylistic cleaning

Make it a bit more like typical kernel style.

Signed-off-by: Joe 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Joe Perches 2009-09-22 16:44:24 -07:00 committed by Linus Torvalds
parent 0a7ff7c757
commit 75d145283b

View File

@ -43,7 +43,6 @@
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/htc_pwrsink.h> #include <mach/htc_pwrsink.h>
#include "msm_sdcc.h" #include "msm_sdcc.h"
#define DRIVER_NAME "msm-sdcc" #define DRIVER_NAME "msm-sdcc"
@ -58,8 +57,6 @@ static unsigned int msmsdcc_sdioirq;
#define PIO_SPINMAX 30 #define PIO_SPINMAX 30
#define CMD_SPINMAX 20 #define CMD_SPINMAX 20
static void static void
msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd,
u32 c); u32 c);
@ -98,16 +95,17 @@ msmsdcc_stop_data(struct msmsdcc_host *host)
uint32_t msmsdcc_fifo_addr(struct msmsdcc_host *host) uint32_t msmsdcc_fifo_addr(struct msmsdcc_host *host)
{ {
if (host->pdev_id == 1) switch (host->pdev_id) {
case 1:
return MSM_SDC1_PHYS + MMCIFIFO; return MSM_SDC1_PHYS + MMCIFIFO;
else if (host->pdev_id == 2) case 2:
return MSM_SDC2_PHYS + MMCIFIFO; return MSM_SDC2_PHYS + MMCIFIFO;
else if (host->pdev_id == 3) case 3:
return MSM_SDC3_PHYS + MMCIFIFO; return MSM_SDC3_PHYS + MMCIFIFO;
else if (host->pdev_id == 4) case 4:
return MSM_SDC4_PHYS + MMCIFIFO; return MSM_SDC4_PHYS + MMCIFIFO;
else }
BUG(); BUG();
return 0; return 0;
} }
@ -156,8 +154,8 @@ msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd,
struct scatterlist *sg = host->dma.sg; struct scatterlist *sg = host->dma.sg;
int i; int i;
for (i = 0; i < host->dma.num_ents; i++, sg++) for (i = 0; i < host->dma.num_ents; i++)
flush_dcache_page(sg_page(sg)); flush_dcache_page(sg_page(sg++));
} }
host->dma.sg = NULL; host->dma.sg = NULL;
@ -222,15 +220,20 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data)
nc = host->dma.nc; nc = host->dma.nc;
if (host->pdev_id == 1) switch (host->pdev_id) {
case 1:
crci = MSMSDCC_CRCI_SDC1; crci = MSMSDCC_CRCI_SDC1;
else if (host->pdev_id == 2) break;
case 2:
crci = MSMSDCC_CRCI_SDC2; crci = MSMSDCC_CRCI_SDC2;
else if (host->pdev_id == 3) break;
case 3:
crci = MSMSDCC_CRCI_SDC3; crci = MSMSDCC_CRCI_SDC3;
else if (host->pdev_id == 4) break;
case 4:
crci = MSMSDCC_CRCI_SDC4; crci = MSMSDCC_CRCI_SDC4;
else { break;
default:
host->dma.sg = NULL; host->dma.sg = NULL;
host->dma.num_ents = 0; host->dma.num_ents = 0;
return -ENOENT; return -ENOENT;
@ -244,7 +247,7 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data)
host->curr.user_pages = 0; host->curr.user_pages = 0;
n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg, n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg,
host->dma.num_ents, host->dma.dir); host->dma.num_ents, host->dma.dir);
if (n != host->dma.num_ents) { if (n != host->dma.num_ents) {
pr_err("%s: Unable to map in all sg elements\n", pr_err("%s: Unable to map in all sg elements\n",
@ -318,7 +321,7 @@ msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data)
memset(&host->pio, 0, sizeof(host->pio)); memset(&host->pio, 0, sizeof(host->pio));
clks = (unsigned long long)data->timeout_ns * host->clk_rate; clks = (unsigned long long)data->timeout_ns * host->clk_rate;
do_div(clks, 1000000000UL); do_div(clks, NSEC_PER_SEC);
timeout = data->timeout_clks + (unsigned int)clks; timeout = data->timeout_clks + (unsigned int)clks;
writel(timeout, base + MMCIDATATIMER); writel(timeout, base + MMCIDATATIMER);
@ -371,9 +374,9 @@ msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, u32 c)
c |= MCI_CPSM_RESPONSE; c |= MCI_CPSM_RESPONSE;
} }
if ((((cmd->opcode == 17) || (cmd->opcode == 18)) || if (cmd->opcode == 17 || cmd->opcode == 18 ||
((cmd->opcode == 24) || (cmd->opcode == 25))) || cmd->opcode == 24 || cmd->opcode == 25 ||
(cmd->opcode == 53)) cmd->opcode == 53)
c |= MCI_CSPM_DATCMD; c |= MCI_CSPM_DATCMD;
if (cmd == cmd->mrq->stop) if (cmd == cmd->mrq->stop)