diff options
author | Marek Vasut <marex@denx.de> | 2015-10-23 20:46:31 +0200 |
---|---|---|
committer | Andreas Bießmann <andreas.devel@googlemail.com> | 2015-11-01 22:02:15 +0100 |
commit | 877807e193340b2586bc328bb000f32fde986be4 (patch) | |
tree | d5ee794857055e97d3f4371accc014ddda96713f /drivers/mmc/gen_atmel_mci.c | |
parent | 6b75d35949968ea2083d5778de6882e175ecc3d0 (diff) |
mmc: atmel: Zap global 'initialized' variable
Global variables are bad. Get rid of this particular one, so we can
correctly instantiate multiple atmel mci interfaces, without having
them interfere with one another.
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Diffstat (limited to 'drivers/mmc/gen_atmel_mci.c')
-rw-r--r-- | drivers/mmc/gen_atmel_mci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index 74d53a3140..da870c646e 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -35,10 +35,9 @@ struct atmel_mci_priv { struct mmc_config cfg; struct atmel_mci *mci; + unsigned int initialized:1; }; -static int initialized = 0; - /* Read Atmel MCI IP version */ static unsigned int atmel_mci_get_version(struct atmel_mci *mci) { @@ -121,7 +120,7 @@ static void mci_set_mode(struct mmc *mmc, u32 hz, u32 blklen) udelay(50); - initialized = 1; + priv->initialized = 1; } /* Return the CMDR with flags for a given command and data packet */ @@ -210,7 +209,7 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) u32 error_flags = 0; u32 status; - if (!initialized) { + if (!priv->initialized) { puts ("MCI not initialized!\n"); return COMM_ERR; } @@ -415,6 +414,7 @@ int atmel_mci_init(void *regs) cfg->ops = &atmel_mci_ops; priv->mci = (struct atmel_mci *)regs; + priv->initialized = 0; /* need to be able to pass these in on a board by board basis */ cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; |