mmc: Convert mmc struct's name array to a pointer
Using an array is pointless; even more pointless (and scary) is using sprintf to fill it without a format string. Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
This commit is contained in:
parent
ab769f227f
commit
22cb7d334e
@ -365,7 +365,7 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host)
|
||||
/* Disable mmc interrupts */
|
||||
sdi_u32 = readl(&host->base->mask0) & ~SDI_MASK0_MASK;
|
||||
writel(sdi_u32, &host->base->mask0);
|
||||
strncpy(dev->name, host->name, sizeof(dev->name));
|
||||
dev->name = host->name;
|
||||
dev->ops = &arm_pl180_mmci_ops;
|
||||
dev->host_caps = host->caps;
|
||||
dev->voltages = host->voltages;
|
||||
|
@ -288,7 +288,7 @@ int bfin_mmc_init(bd_t *bis)
|
||||
|
||||
if (!mmc)
|
||||
return -ENOMEM;
|
||||
sprintf(mmc->name, "Blackfin SDH");
|
||||
mmc->name = "Blackfin SDH";
|
||||
mmc->ops = &bfin_mmc_ops;
|
||||
mmc->host_caps = MMC_MODE_4BIT;
|
||||
|
||||
|
@ -379,7 +379,7 @@ int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host)
|
||||
mmc = malloc(sizeof(struct mmc));
|
||||
memset(mmc, 0, sizeof(struct mmc));
|
||||
|
||||
sprintf(mmc->name, "davinci");
|
||||
mmc->name = "davinci";
|
||||
mmc->priv = host;
|
||||
mmc->ops = &dmmc_ops;
|
||||
mmc->f_min = 200000;
|
||||
|
@ -363,7 +363,7 @@ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk)
|
||||
mmc->priv = host;
|
||||
host->mmc = mmc;
|
||||
|
||||
sprintf(mmc->name, "%s", host->name);
|
||||
mmc->name = host->name;
|
||||
mmc->ops = &dwmci_ops;
|
||||
mmc->f_min = min_clk;
|
||||
mmc->f_max = max_clk;
|
||||
|
@ -545,7 +545,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(mmc, 0, sizeof(struct mmc));
|
||||
sprintf(mmc->name, "FSL_SDHC");
|
||||
mmc->name = "FSL_SDHC";
|
||||
regs = (struct fsl_esdhc *)cfg->esdhc_base;
|
||||
|
||||
/* First reset the eSDHC controller */
|
||||
|
@ -352,7 +352,7 @@ int ftsdc010_mmc_init(int devid)
|
||||
chip->regs = regs;
|
||||
mmc->priv = chip;
|
||||
|
||||
sprintf(mmc->name, "ftsdc010");
|
||||
mmc->name = "ftsdc010";
|
||||
mmc->ops = &ftsdc010_ops;
|
||||
mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz;
|
||||
switch (readl(®s->bwr) & FTSDC010_BWR_CAPS_MASK) {
|
||||
|
@ -364,7 +364,7 @@ int atmel_mci_init(void *regs)
|
||||
if (!mmc)
|
||||
return -1;
|
||||
|
||||
strcpy(mmc->name, "mci");
|
||||
mmc->name = "mci";
|
||||
mmc->priv = regs;
|
||||
mmc->ops = &atmel_mci_ops;
|
||||
|
||||
|
@ -274,7 +274,7 @@ struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode)
|
||||
free(mmc);
|
||||
return NULL;
|
||||
}
|
||||
sprintf(mmc->name, "MMC_SPI");
|
||||
mmc->name = "MMC_SPI";
|
||||
mmc->ops = &mmc_spi_ops;
|
||||
mmc->host_caps = MMC_MODE_SPI;
|
||||
|
||||
|
@ -500,7 +500,7 @@ static int mxcmci_initialize(bd_t *bis)
|
||||
if (!mmc)
|
||||
return -ENOMEM;
|
||||
|
||||
sprintf(mmc->name, "MXC MCI");
|
||||
mmc->name = "MXC MCI";
|
||||
mmc->ops = &mxcmci_ops;
|
||||
mmc->host_caps = MMC_MODE_4BIT;
|
||||
|
||||
|
@ -405,7 +405,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int))
|
||||
priv->id = id;
|
||||
priv->regs = mxs_ssp_regs_by_bus(id);
|
||||
|
||||
sprintf(mmc->name, "MXS MMC");
|
||||
mmc->name = "MXS MMC";
|
||||
mmc->ops = &mxsmmc_ops;
|
||||
mmc->priv = priv;
|
||||
|
||||
|
@ -641,7 +641,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
|
||||
uint host_caps_val = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS |
|
||||
MMC_MODE_HC;
|
||||
|
||||
sprintf(mmc->name, "OMAP SD/MMC");
|
||||
mmc->name = "OMAP SD/MMC";
|
||||
mmc->ops = &omap_hsmmc_ops;
|
||||
mmc->priv = priv_data;
|
||||
|
||||
|
@ -402,7 +402,7 @@ int pxa_mmc_register(int card_index)
|
||||
|
||||
mmc->priv = priv;
|
||||
|
||||
sprintf(mmc->name, "PXA MMC");
|
||||
mmc->name = "PXA MMC";
|
||||
mmc->ops = &pxa_mmc_ops;
|
||||
|
||||
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
|
||||
|
@ -451,7 +451,7 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk)
|
||||
mmc->priv = host;
|
||||
host->mmc = mmc;
|
||||
|
||||
sprintf(mmc->name, "%s", host->name);
|
||||
mmc->name = host->name;
|
||||
mmc->ops = &sdhci_ops;
|
||||
|
||||
caps = sdhci_readl(host, SDHCI_CAPABILITIES);
|
||||
|
@ -600,7 +600,7 @@ int mmcif_mmc_init(void)
|
||||
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
|
||||
mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT |
|
||||
MMC_MODE_8BIT | MMC_MODE_HC;
|
||||
memcpy(mmc->name, DRIVER_NAME, sizeof(DRIVER_NAME));
|
||||
mmc->name = DRIVER_NAME;
|
||||
mmc->ops = &sh_mmcif_ops;
|
||||
host->regs = (struct sh_mmcif_regs *)CONFIG_SH_MMCIF_ADDR;
|
||||
host->clk = CONFIG_SH_MMCIF_CLK;
|
||||
|
@ -563,7 +563,7 @@ static int do_mmc_init(int dev_index)
|
||||
|
||||
mmc = &mmc_dev[dev_index];
|
||||
|
||||
sprintf(mmc->name, "Tegra SD/MMC");
|
||||
mmc->name = "Tegra SD/MMC";
|
||||
mmc->priv = host;
|
||||
mmc->ops = &tegra_mmc_ops;
|
||||
|
||||
|
@ -264,7 +264,7 @@ struct mmc_ops {
|
||||
|
||||
struct mmc {
|
||||
struct list_head link;
|
||||
char name[32];
|
||||
const char *name; /* no need for this to be an array */
|
||||
void *priv;
|
||||
uint voltages;
|
||||
uint version;
|
||||
|
Loading…
Reference in New Issue
Block a user