From: Fabio Estevam Date: Thu, 12 Jan 2012 03:25:04 +0000 (-0200) Subject: mtd: mtdcore: Fix build warning when CONFIG_MTD_CHAR is not defined X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=335a5f409ee3960bda6b112b9d1a89d0a4e0a7eb;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mtd: mtdcore: Fix build warning when CONFIG_MTD_CHAR is not defined Fix the following build warning: drivers/mtd/mtdcore.c: In function ‘mtd_release’: drivers/mtd/mtdcore.c:110: warning: unused variable ‘mtd’ This happens when neither CONFIG_MTD_CHAR nor CONFIG_MTD_CHAR_MODULE are defined. Signed-off-by: Fabio Estevam Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9a9ce71a71fc..de96865b4f96 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -107,7 +107,7 @@ static LIST_HEAD(mtd_notifiers); */ static void mtd_release(struct device *dev) { - struct mtd_info *mtd = dev_get_drvdata(dev); + struct mtd_info __maybe_unused *mtd = dev_get_drvdata(dev); dev_t index = MTD_DEVT(mtd->index); /* remove /dev/mtdXro node if needed */