aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 17:47:00 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 17:47:00 -0800
commitfc8e3d177fa8073895d37b50282489dbeec89eb1 (patch)
tree3e8acd6338bad172486b718647ed3dc1d412dcc9 /drivers
parentad2c1604da74a3bbef96e7259e389ccba0cf613a (diff)
parent936d8592654bb97d5706a73c0e2a6339b090f7fb (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc_block.c10
-rw-r--r--drivers/mmc/pxamci.c1
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index fa83f15fdf1..9b629856c73 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -85,6 +85,12 @@ static void mmc_blk_put(struct mmc_blk_data *md)
up(&open_lock);
}
+static inline int mmc_blk_readonly(struct mmc_card *card)
+{
+ return mmc_card_readonly(card) ||
+ !(card->csd.cmdclass & CCC_BLOCK_WRITE);
+}
+
static int mmc_blk_open(struct inode *inode, struct file *filp)
{
struct mmc_blk_data *md;
@@ -97,7 +103,7 @@ static int mmc_blk_open(struct inode *inode, struct file *filp)
ret = 0;
if ((filp->f_mode & FMODE_WRITE) &&
- mmc_card_readonly(md->queue.card))
+ mmc_blk_readonly(md->queue.card))
ret = -EROFS;
}
@@ -410,7 +416,7 @@ static int mmc_blk_probe(struct mmc_card *card)
printk(KERN_INFO "%s: %s %s %dKiB %s\n",
md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
(card->csd.capacity << card->csd.read_blkbits) / 1024,
- mmc_card_readonly(card)?"(ro)":"");
+ mmc_blk_readonly(card)?"(ro)":"");
mmc_set_drvdata(card, md);
add_disk(md->disk);
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index 8eba373d42d..d575e3a018b 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -29,7 +29,6 @@
#include <asm/dma.h>
#include <asm/io.h>
-#include <asm/irq.h>
#include <asm/scatterlist.h>
#include <asm/sizes.h>