summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-05-01 11:09:52 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-05-15 08:31:36 +0200
commitc7527b70f96791c1ee746c870f4e728ed73f2bb9 (patch)
tree7c62e2a78f31a6fcaf7163fd7b4f9d0fc7246e68 /drivers/mmc
parent7dec1bd11f350fa56cef00fafc507c14dbfd624c (diff)
downloadu-boot-imx-c7527b70f96791c1ee746c870f4e728ed73f2bb9.zip
u-boot-imx-c7527b70f96791c1ee746c870f4e728ed73f2bb9.tar.gz
u-boot-imx-c7527b70f96791c1ee746c870f4e728ed73f2bb9.tar.bz2
i.MX28: Check if WP detection is implemented at all
If the WP function is NULL, simply assume the card is always RW. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Detlev Zundel <dzu@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mxsmmc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 35c6bda..c7200ee 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -133,7 +133,8 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
/* READ or WRITE */
if (data->flags & MMC_DATA_READ) {
ctrl0 |= SSP_CTRL0_READ;
- } else if (priv->mmc_is_wp(mmc->block_dev.dev)) {
+ } else if (priv->mmc_is_wp &&
+ priv->mmc_is_wp(mmc->block_dev.dev)) {
printf("MMC%d: Can not write a locked card!\n",
mmc->block_dev.dev);
return UNUSABLE_ERR;