public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: blktrans: change blktrans_getgeo rerurn value
@ 2015-05-13  6:29 Wenlin Kang
  2015-05-20 19:33 ` Brian Norris
  0 siblings, 1 reply; 11+ messages in thread
From: Wenlin Kang @ 2015-05-13  6:29 UTC (permalink / raw)
  To: dwmw2, computersforpeace; +Cc: linux-mtd, linux-kernel

Modify function blktrans_getgeo()'s return value to -ENXIO 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 return 0, it will make some
application get the wrong information.

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
---
 drivers/mtd/mtd_blkdevs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 2b0c5287..f8bb16e 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -273,7 +273,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) : -ENXIO;
 unlock:
 	mutex_unlock(&dev->lock);
 	blktrans_dev_put(dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-05-27 19:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13  6:29 [PATCH] mtd: blktrans: change blktrans_getgeo rerurn value Wenlin Kang
2015-05-20 19:33 ` Brian Norris
     [not found]   ` <555CE4BF.8020506@gmail.com>
2015-05-21  6:49     ` Wenlin Kang
2015-05-21  7:37       ` Brian Norris
2015-05-21  8:01         ` Wenlin Kang
2015-05-21  7:56   ` Richard Weinberger
2015-05-21  8:05     ` Brian Norris
2015-05-21  8:22       ` Wenlin Kang
2015-05-21 10:17       ` Richard Weinberger
2015-05-21 17:54         ` [PATCH] mtd: blktrans: use better error code for unimplemented ioctl() Brian Norris
2015-05-27 19:15           ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox