diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:47:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:47:00 -0500 |
commit | fc8e3d177fa8073895d37b50282489dbeec89eb1 (patch) | |
tree | 3e8acd6338bad172486b718647ed3dc1d412dcc9 /drivers | |
parent | ad2c1604da74a3bbef96e7259e389ccba0cf613a (diff) | |
parent | 936d8592654bb97d5706a73c0e2a6339b090f7fb (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/mmc_block.c | 10 | ||||
-rw-r--r-- | drivers/mmc/pxamci.c | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index fa83f15fdf16..9b629856c735 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) | |||
85 | up(&open_lock); | 85 | up(&open_lock); |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline int mmc_blk_readonly(struct mmc_card *card) | ||
89 | { | ||
90 | return mmc_card_readonly(card) || | ||
91 | !(card->csd.cmdclass & CCC_BLOCK_WRITE); | ||
92 | } | ||
93 | |||
88 | static int mmc_blk_open(struct inode *inode, struct file *filp) | 94 | static int mmc_blk_open(struct inode *inode, struct file *filp) |
89 | { | 95 | { |
90 | struct mmc_blk_data *md; | 96 | struct mmc_blk_data *md; |
@@ -97,7 +103,7 @@ static int mmc_blk_open(struct inode *inode, struct file *filp) | |||
97 | ret = 0; | 103 | ret = 0; |
98 | 104 | ||
99 | if ((filp->f_mode & FMODE_WRITE) && | 105 | if ((filp->f_mode & FMODE_WRITE) && |
100 | mmc_card_readonly(md->queue.card)) | 106 | mmc_blk_readonly(md->queue.card)) |
101 | ret = -EROFS; | 107 | ret = -EROFS; |
102 | } | 108 | } |
103 | 109 | ||
@@ -410,7 +416,7 @@ static int mmc_blk_probe(struct mmc_card *card) | |||
410 | printk(KERN_INFO "%s: %s %s %dKiB %s\n", | 416 | printk(KERN_INFO "%s: %s %s %dKiB %s\n", |
411 | md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), | 417 | md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), |
412 | (card->csd.capacity << card->csd.read_blkbits) / 1024, | 418 | (card->csd.capacity << card->csd.read_blkbits) / 1024, |
413 | mmc_card_readonly(card)?"(ro)":""); | 419 | mmc_blk_readonly(card)?"(ro)":""); |
414 | 420 | ||
415 | mmc_set_drvdata(card, md); | 421 | mmc_set_drvdata(card, md); |
416 | add_disk(md->disk); | 422 | add_disk(md->disk); |
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index 8eba373d42d7..d575e3a018bc 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -29,7 +29,6 @@ | |||
29 | 29 | ||
30 | #include <asm/dma.h> | 30 | #include <asm/dma.h> |
31 | #include <asm/io.h> | 31 | #include <asm/io.h> |
32 | #include <asm/irq.h> | ||
33 | #include <asm/scatterlist.h> | 32 | #include <asm/scatterlist.h> |
34 | #include <asm/sizes.h> | 33 | #include <asm/sizes.h> |
35 | 34 | ||