Skip to content

Commit 2fdb114

Browse files
dlunevDavid Woodhouse
authored andcommitted
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@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 0882e8d commit 2fdb114

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/mtd/mtdcore.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ static LIST_HEAD(mtd_notifiers);
4848
*/
4949
static void mtd_release(struct device *dev)
5050
{
51-
struct mtd_info *mtd = dev_to_mtd(dev);
51+
dev_t index = MTD_DEVT(dev_to_mtd(dev)->index);
5252

5353
/* remove /dev/mtdXro node if needed */
54-
if (MTD_DEVT(mtd->index))
55-
device_destroy(mtd_class, MTD_DEVT(mtd->index) + 1);
54+
if (index)
55+
device_destroy(mtd_class, index + 1);
5656
}
5757

5858
static ssize_t mtd_type_show(struct device *dev,

0 commit comments

Comments
 (0)