summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtd_blkdevs.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-23 09:33:58 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-08-23 10:01:13 +0200
commit37b143d12b5f099bb4375162303ff1df1692cc5e (patch)
tree8d19bf7c579f37bcac93ff5e509cce1151e6adf3 /drivers/mtd/mtd_blkdevs.c
parentmtd_blkdevs: remove blktrans_ref_mutex (diff)
downloadlinux-37b143d12b5f099bb4375162303ff1df1692cc5e.tar.xz
linux-37b143d12b5f099bb4375162303ff1df1692cc5e.zip
mtd_blkdevs: simplify blktrans_getgeo
No need to grab a mtd_blktrans_dev given that ->open already holds one and ->getgeo can only be called on an open disk. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-8-hch@lst.de
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r--drivers/mtd/mtd_blkdevs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 84bcad1b7408..e8eb4d801b15 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -257,7 +257,7 @@ unlock:
static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
- struct mtd_blktrans_dev *dev = blktrans_dev_get(bdev->bd_disk);
+ struct mtd_blktrans_dev *dev = bdev->bd_disk->private_data;
int ret = -ENXIO;
mutex_lock(&dev->lock);
@@ -268,7 +268,6 @@ static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo)
ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : -ENOTTY;
unlock:
mutex_unlock(&dev->lock);
- blktrans_dev_put(dev);
return ret;
}