diff options
author | Christoph Hellwig <hch@lst.de> | 2023-06-08 13:02:50 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-06-12 08:04:04 -0600 |
commit | 658afed19ceed54a52b9e9e69c0791c8868ff55d (patch) | |
tree | 9cc7a0c3a565bc8629cfb41e412fbb863fed8e58 /drivers/mtd/mtd_blkdevs.c | |
parent | 7d9d7d59d44b7e9236d168472aa222b6543fae25 (diff) | |
download | lwn-658afed19ceed54a52b9e9e69c0791c8868ff55d.tar.gz lwn-658afed19ceed54a52b9e9e69c0791c8868ff55d.zip |
mtd: block: use a simple bool to track open for write
Instead of propagating the fmode_t, just use a bool to track if a mtd
block device was opened for writing.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Richard Weinberger <richard@nod.at>
Link: https://lore.kernel.org/r/20230608110258.189493-23-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index f0bb09fde95e..bd0b75453643 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -208,7 +208,7 @@ static int blktrans_open(struct gendisk *disk, fmode_t mode) ret = __get_mtd_device(dev->mtd); if (ret) goto error_release; - dev->file_mode = mode; + dev->writable = mode & FMODE_WRITE; unlock: dev->open++; |