Skip to content

Commit

Permalink
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Oct 31, 2005
2 parents ad2c160 + 936d859 commit fc8e3d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions drivers/mmc/mmc_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion drivers/mmc/pxamci.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include <asm/dma.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/scatterlist.h>
#include <asm/sizes.h>

Expand Down

0 comments on commit fc8e3d1

Please sign in to comment.