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
This commit is contained in:
parent
560a3915e3
commit
37b143d12b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user