Skip to content

Commit 3f34d6f

Browse files
jkrzysztgregkh
authored andcommitted
mtd: rawnand: ams-delta: Fix non-OF build warning
[ Upstream commit 6d11178 ] Commit 7c2f66a ("mtd: rawnand: ams-delta: Add module device tables") introduced an OF module device table but wrapped a reference to it with of_match_ptr() which resolves to NULL in non-OF configs. That resulted in a clang compiler warning on unused variable in non-OF builds. Fix it. drivers/mtd/nand/raw/ams-delta.c:373:34: warning: unused variable 'gpio_nand_of_id_table' [-Wunused-const-variable] static const struct of_device_id gpio_nand_of_id_table[] = { ^ 1 warning generated. Fixes: 7c2f66a ("mtd: rawnand: ams-delta: Add module device tables") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200919080403.17520-1-jmkrzyszt@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4e8d0f2 commit 3f34d6f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/mtd/nand/raw/ams-delta.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,14 @@ static int gpio_nand_remove(struct platform_device *pdev)
400400
return 0;
401401
}
402402

403+
#ifdef CONFIG_OF
403404
static const struct of_device_id gpio_nand_of_id_table[] = {
404405
{
405406
/* sentinel */
406407
},
407408
};
408409
MODULE_DEVICE_TABLE(of, gpio_nand_of_id_table);
410+
#endif
409411

410412
static const struct platform_device_id gpio_nand_plat_id_table[] = {
411413
{

0 commit comments

Comments
 (0)