summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-29 15:25:51 -0700
committerSimon Glass <sjg@chromium.org>2016-03-14 15:34:50 -0600
commitbcce53d048de7f41078d25e39aa2f26d752d3658 (patch)
tree5eb88ab671c7ec923cfb4fe9c0d3dc4715adb93d /drivers/mmc
parent782b97805e9f59cc2b4d3aa67a8a03248e8cd722 (diff)
downloadu-boot-bcce53d048de7f41078d25e39aa2f26d752d3658.tar.gz
u-boot-bcce53d048de7f41078d25e39aa2f26d752d3658.tar.xz
u-boot-bcce53d048de7f41078d25e39aa2f26d752d3658.zip
dm: block: Rename device number member dev to devnum
This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/arm_pl180_mmci.c2
-rw-r--r--drivers/mmc/mmc.c8
-rw-r--r--drivers/mmc/mmc_write.c4
-rw-r--r--drivers/mmc/mxsmmc.c24
-rw-r--r--drivers/mmc/omap_hsmmc.c4
-rw-r--r--drivers/mmc/sdhci.c2
6 files changed, 22 insertions, 22 deletions
diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c
index 5ef7ff7ff2..8f2694f14c 100644
--- a/drivers/mmc/arm_pl180_mmci.c
+++ b/drivers/mmc/arm_pl180_mmci.c
@@ -375,7 +375,7 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host)
if (mmc == NULL)
return -1;
- debug("registered mmc interface number is:%d\n", mmc->block_dev.dev);
+ debug("registered mmc interface number is:%d\n", mmc->block_dev.devnum);
return 0;
}
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 94afbb105e..8b2e6069ea 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -182,7 +182,7 @@ struct mmc *find_mmc_device(int dev_num)
list_for_each(entry, &mmc_devices) {
m = list_entry(entry, struct mmc, link);
- if (m->block_dev.dev == dev_num)
+ if (m->block_dev.devnum == dev_num)
return m;
}
@@ -237,7 +237,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
static ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, void *dst)
{
- int dev_num = block_dev->dev;
+ int dev_num = block_dev->devnum;
int err;
lbaint_t cur, blocks_todo = blkcnt;
@@ -1556,7 +1556,7 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
mmc->dsr = 0xffffffff;
/* Setup the universal parts of the block interface just once */
mmc->block_dev.if_type = IF_TYPE_MMC;
- mmc->block_dev.dev = cur_dev_num++;
+ mmc->block_dev.devnum = cur_dev_num++;
mmc->block_dev.removable = 1;
mmc->block_dev.block_read = mmc_bread;
mmc->block_dev.block_write = mmc_bwrite;
@@ -1728,7 +1728,7 @@ void print_mmc_devices(char separator)
else
mmc_type = NULL;
- printf("%s: %d", m->cfg->name, m->block_dev.dev);
+ printf("%s: %d", m->cfg->name, m->block_dev.devnum);
if (mmc_type)
printf(" (%s)", mmc_type);
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index 54e60dbe9c..7b186f8500 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -68,7 +68,7 @@ err_out:
unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt)
{
- int dev_num = block_dev->dev;
+ int dev_num = block_dev->devnum;
int err = 0;
u32 start_rem, blkcnt_rem;
struct mmc *mmc = find_mmc_device(dev_num);
@@ -174,7 +174,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
const void *src)
{
- int dev_num = block_dev->dev;
+ int dev_num = block_dev->devnum;
lbaint_t cur, blocks_todo = blkcnt;
int err;
diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 31fb3abc9c..9fa87d5717 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -142,7 +142,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
uint32_t ctrl0;
int ret;
- debug("MMC%d: CMD%d\n", mmc->block_dev.dev, cmd->cmdidx);
+ debug("MMC%d: CMD%d\n", mmc->block_dev.devnum, cmd->cmdidx);
/* Check bus busy */
timeout = MXSMMC_MAX_TIMEOUT;
@@ -157,13 +157,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
}
if (!timeout) {
- printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.dev);
+ printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.devnum);
return TIMEOUT;
}
/* See if card is present */
if (!mxsmmc_cd(priv)) {
- printf("MMC%d: No card detected!\n", mmc->block_dev.dev);
+ printf("MMC%d: No card detected!\n", mmc->block_dev.devnum);
return NO_CARD_ERR;
}
@@ -200,9 +200,9 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
if (data->flags & MMC_DATA_READ) {
ctrl0 |= SSP_CTRL0_READ;
} else if (priv->mmc_is_wp &&
- priv->mmc_is_wp(mmc->block_dev.dev)) {
+ priv->mmc_is_wp(mmc->block_dev.devnum)) {
printf("MMC%d: Can not write a locked card!\n",
- mmc->block_dev.dev);
+ mmc->block_dev.devnum);
return UNUSABLE_ERR;
}
@@ -243,21 +243,21 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
if (!timeout) {
printf("MMC%d: Command %d busy\n",
- mmc->block_dev.dev, cmd->cmdidx);
+ mmc->block_dev.devnum, cmd->cmdidx);
return TIMEOUT;
}
/* Check command timeout */
if (reg & SSP_STATUS_RESP_TIMEOUT) {
printf("MMC%d: Command %d timeout (status 0x%08x)\n",
- mmc->block_dev.dev, cmd->cmdidx, reg);
+ mmc->block_dev.devnum, cmd->cmdidx, reg);
return TIMEOUT;
}
/* Check command errors */
if (reg & (SSP_STATUS_RESP_CRC_ERR | SSP_STATUS_RESP_ERR)) {
printf("MMC%d: Command %d error (status 0x%08x)!\n",
- mmc->block_dev.dev, cmd->cmdidx, reg);
+ mmc->block_dev.devnum, cmd->cmdidx, reg);
return COMM_ERR;
}
@@ -279,14 +279,14 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
if (ret) {
printf("MMC%d: Data timeout with command %d "
"(status 0x%08x)!\n",
- mmc->block_dev.dev, cmd->cmdidx, reg);
+ mmc->block_dev.devnum, cmd->cmdidx, reg);
return ret;
}
} else {
ret = mxsmmc_send_cmd_dma(priv, data);
if (ret) {
printf("MMC%d: DMA transfer failed\n",
- mmc->block_dev.dev);
+ mmc->block_dev.devnum);
return ret;
}
}
@@ -297,7 +297,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
(SSP_STATUS_TIMEOUT | SSP_STATUS_DATA_CRC_ERR |
SSP_STATUS_FIFO_OVRFLW | SSP_STATUS_FIFO_UNDRFLW)) {
printf("MMC%d: Data error with command %d (status 0x%08x)!\n",
- mmc->block_dev.dev, cmd->cmdidx, reg);
+ mmc->block_dev.devnum, cmd->cmdidx, reg);
return COMM_ERR;
}
@@ -330,7 +330,7 @@ static void mxsmmc_set_ios(struct mmc *mmc)
SSP_CTRL0_BUS_WIDTH_MASK, priv->buswidth);
debug("MMC%d: Set %d bits bus width\n",
- mmc->block_dev.dev, mmc->bus_width);
+ mmc->block_dev.devnum, mmc->bus_width);
}
static int mxsmmc_init(struct mmc *mmc)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 5038a9f55f..5f2db3b5cf 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -177,11 +177,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
#if defined(CONFIG_OMAP44XX) && defined(CONFIG_TWL6030_POWER)
/* PBIAS config needed for MMC1 only */
- if (mmc->block_dev.dev == 0)
+ if (mmc->block_dev.devnum == 0)
omap4_vmmc_pbias_config(mmc);
#endif
#if defined(CONFIG_OMAP54XX) && defined(CONFIG_PALMAS_POWER)
- if (mmc->block_dev.dev == 0)
+ if (mmc->block_dev.devnum == 0)
omap5_pbias_config(mmc);
#endif
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 8586d898fd..ef7e6150f9 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -137,7 +137,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
int trans_bytes = 0, is_aligned = 1;
u32 mask, flags, mode;
unsigned int time = 0, start_addr = 0;
- int mmc_dev = mmc->block_dev.dev;
+ int mmc_dev = mmc->block_dev.devnum;
unsigned start = get_timer(0);
/* Timeout unit - ms */