block = sizes / 512;
if (block >= 99) {
printk("cmd53 error blocks\n");
- while (1);
+ while (1)
+ ;
}
cmd = bRx ? &result->cmd53_rx_blk[block] : &result->cmd53_tx_blk[block];
}
int id, zone;
int mode, size;
- if (count == 0)return -1;
- if (count > 255)count = 255;
+ if (count == 0)
+ return -1;
+ if (count > 255)
+ count = 255;
ret = copy_from_user(cmd_buf, buf, count);
- if (ret < 0)return -1;
+ if (ret < 0)
+ return -1;
cmd_buf[count] = '\0';
printk("msdc Write %s\n", cmd_buf);
sscanf(cmd_buf, "%x %x %x", &cmd, &p1, &p2);
if (cmd == SD_TOOL_ZONE) {
- id = p1; zone = p2; zone &= 0x3ff;
+ id = p1;
+ zone = p2;
+ zone &= 0x3ff;
printk("msdc host_id<%d> zone<0x%.8x>\n", id, zone);
if (id >= 0 && id <= 3) {
sd_debug_zone[id] = zone;
printk("msdc host_id error when set debug zone\n");
}
} else if (cmd == SD_TOOL_DMA_SIZE) {
- id = p1 >> 4; mode = (p1 & 0xf); size = p2;
+ id = p1 >> 4;
+ mode = (p1 & 0xf);
+ size = p2;
if (id >= 0 && id <= 3) {
drv_mode[id] = mode;
dma_size[id] = p2;
gpt_enable = 1;
}
sdio_pro_enable = 1;
- if (p2 == 0) p2 = 1; if (p2 >= 30) p2 = 30;
+ if (p2 == 0)
+ p2 = 1;
+ if (p2 >= 30)
+ p2 = 30;
sdio_pro_time = p2;
} else if (p1 == 0) {
/* todo */
do { \
int backup = cnt; \
while (retry) { \
- if (!(expr)) break; \
+ if (!(expr)) \
+ break; \
if (cnt-- == 0) { \
retry--; mdelay(1); cnt = backup; \
} \
sdr_set_field(MSDC_CFG, MSDC_CFG_CKDIV, div);
/* wait clock stable */
- while (!(sdr_read32(MSDC_CFG) & MSDC_CFG_CKSTB));
+ while (!(sdr_read32(MSDC_CFG) & MSDC_CFG_CKSTB))
+ ;
host->sclk = sclk;
host->mclk = hz;
N_MSG(FIO, " PIO Read<%d>bytes", size);
sdr_clr_bits(MSDC_INTEN, wints);
- if (data->error) ERR_MSG("read pio data->error<%d> left<%d> size<%d>", data->error, left, size);
+ if (data->error)
+ ERR_MSG("read pio data->error<%d> left<%d> size<%d>", data->error, left, size);
return data->error;
}
end:
data->bytes_xfered += size;
N_MSG(FIO, " PIO Write<%d>bytes", size);
- if (data->error) ERR_MSG("write pio data->error<%d>", data->error);
+ if (data->error)
+ ERR_MSG("write pio data->error<%d>", data->error);
sdr_clr_bits(MSDC_INTEN, wints);
return data->error;
//while (sdr_read32(MSDC_DMA_CFG) & MSDC_DMA_CFG_STS);
sdr_set_field(MSDC_DMA_CTRL, MSDC_DMA_CTRL_STOP, 1);
- while (sdr_read32(MSDC_DMA_CFG) & MSDC_DMA_CFG_STS);
+ while (sdr_read32(MSDC_DMA_CFG) & MSDC_DMA_CFG_STS)
+ ;
//dsb(); /* --- by chhung */
sdr_clr_bits(MSDC_INTEN, wints); /* Not just xfer_comp */
#endif
#endif /* end of --- */
- if (mrq->cmd->error) host->error = 0x001;
- if (mrq->data && mrq->data->error) host->error |= 0x010;
- if (mrq->stop && mrq->stop->error) host->error |= 0x100;
+ if (mrq->cmd->error)
+ host->error = 0x001;
+ if (mrq->data && mrq->data->error)
+ host->error |= 0x010;
+ if (mrq->stop && mrq->stop->error)
+ host->error |= 0x100;
//if (host->error) ERR_MSG("host->error<%d>", host->error);
result = msdc_do_request(mmc, mrq);
sdr_get_field(SDC_DCRC_STS, SDC_DCRC_STS_POS | SDC_DCRC_STS_NEG, dcrc); /* RO */
- if (!ddr) dcrc &= ~SDC_DCRC_STS_NEG;
+ if (!ddr)
+ dcrc &= ~SDC_DCRC_STS_NEG;
ERR_MSG("TUNE_BREAD<%s> dcrc<0x%x> DATRDDLY0/1<0x%x><0x%x> dsmpl<0x%x>",
(result == 0 && dcrc == 0) ? "PASS" : "FAIL", dcrc,
sdr_read32(MSDC_DAT_RDDLY0), sdr_read32(MSDC_DAT_RDDLY1), cur_dsmpl);
do {
err = msdc_get_card_status(mmc, host, &status);
- if (err) return err;
+ if (err)
+ return err;
/* need cmd12? */
ERR_MSG("cmd<13> resp<0x%x>", status);
} while (R1_CURRENT_STATE(status) == 7);
/* Allocate MMC host for this device */
mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev);
- if (!mmc) return -ENOMEM;
+ if (!mmc)
+ return -ENOMEM;
hw = (struct msdc_hw *)pdev->dev.platform_data;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
else
ret = request_irq((unsigned int)irq, msdc_irq, IRQF_TRIGGER_LOW, dev_name(&pdev->dev), host);
- if (ret) goto release;
+ if (ret)
+ goto release;
// mt65xx_irq_unmask(irq); /* --- by chhung */
if (hw->flags & MSDC_CD_PIN_EN) { /* not set for sdio */
platform_set_drvdata(pdev, mmc);
ret = mmc_add_host(mmc);
- if (ret) goto free_irq;
+ if (ret)
+ goto free_irq;
/* Config card detection pin and enable interrupts */
if (hw->flags & MSDC_CD_PIN_EN) { /* set for card */