diff options
author | Wenlin Kang <wenlin.kang@windriver.com> | 2015-05-21 08:49:38 +0200 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-05-21 09:26:41 +0200 |
commit | 50183936254b76997d222cd36bac997ebf8115de (patch) | |
tree | 2ca594357a439c9b630aebf693cf629708c77d30 /drivers/mtd/mtd_blkdevs.c | |
parent | mtd: mxc_nand: generate nand_ecclayout for 8 bit ECC (diff) | |
download | linux-50183936254b76997d222cd36bac997ebf8115de.tar.xz linux-50183936254b76997d222cd36bac997ebf8115de.zip |
mtd: blktrans: change blktrans_getgeo return value
Modify function blktrans_getgeo()'s return value to -EOPNOTSUPP when
dev->tr->getgeo == NULL.
We shouldn't make the return value to 0 when dev->tr->getgeo == NULL,
because the function blktrans_getgeo() has an output value "hd_geometry"
which is usually used by some application, if returns 0 (i.e.,
"success"), it will make some application get the wrong information.
Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
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 df7c6c70757a..c545c9325acf 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -278,7 +278,7 @@ static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo) if (!dev->mtd) goto unlock; - ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : 0; + ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : -EOPNOTSUPP; unlock: mutex_unlock(&dev->lock); blktrans_dev_put(dev); |