mtd: mtd in mtd_release is unused without CONFIG_MTD_CHAR

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun Apr 19 04:59:01 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2fdb11449ca82f4f1907fce4929df4e0bd267c50
Commit:     2fdb11449ca82f4f1907fce4929df4e0bd267c50
Parent:     0882e8dd3aad33eca41696d463bb896e6c8817eb
Author:     Denis V. Lunev <den at openvz.org>
AuthorDate: Sun Apr 12 08:14:46 2009 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun Apr 19 08:59:17 2009 +0100

    mtd: mtd in mtd_release is unused without CONFIG_MTD_CHAR
    
    drivers/mtd/mtdcore.c: In function 'mtd_release':
    drivers/mtd/mtdcore.c:51: warning: unused variable 'mtd'
    
    [akpm: make it actually build]
    Signed-off-by: Denis V. Lunev <den at openvz.org>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdcore.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index fdd6ae8..051b4d4 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -48,11 +48,11 @@ static LIST_HEAD(mtd_notifiers);
  */
 static void mtd_release(struct device *dev)
 {
-	struct mtd_info *mtd = dev_to_mtd(dev);
+	dev_t index = MTD_DEVT(dev_to_mtd(dev)->index);
 
 	/* remove /dev/mtdXro node if needed */
-	if (MTD_DEVT(mtd->index))
-		device_destroy(mtd_class, MTD_DEVT(mtd->index) + 1);
+	if (index)
+		device_destroy(mtd_class, index + 1);
 }
 
 static ssize_t mtd_type_show(struct device *dev,



More information about the linux-mtd-cvs mailing list