mtd: mtd in mtd_release is unused without CONFIG_MTD_CHAR
authorDenis V. Lunev <den@openvz.org>
Sun, 12 Apr 2009 07:14:46 +0000 (08:14 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 19 Apr 2009 07:59:17 +0000 (08:59 +0100)
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@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdcore.c

index fdd6ae8..051b4d4 100644 (file)
@@ -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,