diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 05:39:31 +0300 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 05:39:31 +0300 |
commit | c2cc87ca9561ddfe744d446789cc10f507e87db9 (patch) | |
tree | d505fc0110eb1a3d8750ba2f67648c131f0d9aca /drivers/mmc | |
parent | ce1eeb95fc4eb25109c00bea3e83a87eeff6b07d (diff) | |
parent | 7015faa7df829876a0f931cd18aa6d7c24a1b581 (diff) | |
download | linux-c2cc87ca9561ddfe744d446789cc10f507e87db9.tar.xz |
Merge branch 'master'
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/mmc_block.c | 10 | ||||
-rw-r--r-- | drivers/mmc/pxamci.c | 3 | ||||
-rw-r--r-- | drivers/mmc/wbsd.c | 2 |
3 files changed, 10 insertions, 5 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) 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 8eba373d42d7..f31e247b2cbe 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c @@ -20,7 +20,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/ioport.h> -#include <linux/device.h> +#include <linux/platform_device.h> #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/dma-mapping.h> @@ -29,7 +29,6 @@ #include <asm/dma.h> #include <asm/io.h> -#include <asm/irq.h> #include <asm/scatterlist.h> #include <asm/sizes.h> diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 3ace875decc4..942668e93a74 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -26,7 +26,7 @@ #include <linux/moduleparam.h> #include <linux/init.h> #include <linux/ioport.h> -#include <linux/device.h> +#include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/dma-mapping.h> #include <linux/delay.h> |