mtd: rawnand: Fix misuses of of_match_node()
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 27 Jan 2022 11:08:02 +0000 (12:08 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 31 Jan 2022 16:18:05 +0000 (17:18 +0100)
On non-OF enabled platforms (CONFIG_OF is not set), of_match_node() will
expand to NULL. The of_device_id array pointed by the macro will then be
left unused. Let's mark the array __maybe_unused in this case to prevent
compiler warnings.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/linux-mtd/20220127110802.1064963-1-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/atmel/nand-controller.c
drivers/mtd/nand/raw/atmel/pmecc.c
drivers/mtd/nand/raw/brcmnand/brcmnand.c

index 4ecbaccf5526ffa51453cc944037610a5c0e17b3..0209f7462635cda85ed1f4470db0cc4c9af44a47 100644 (file)
@@ -1938,7 +1938,7 @@ static const struct atmel_smc_nand_ebi_csa_cfg sam9x60_ebi_csa = {
        .nfd0_on_d16 = AT91_SFR_CCFG_NFD0_ON_D16,
 };
 
-static const struct of_device_id atmel_ebi_csa_regmap_of_ids[] = {
+static const struct of_device_id __maybe_unused atmel_ebi_csa_regmap_of_ids[] = {
        {
                .compatible = "atmel,at91sam9260-matrix",
                .data = &at91sam9260_ebi_csa,
index 43ebd78816c03f77678ec70dc8c342fb668f1a11..4d7dc8a9c373851e3cfafc7cb4104de6f7af9802 100644 (file)
@@ -920,7 +920,7 @@ static struct atmel_pmecc_caps sama5d2_caps = {
        .correct_erased_chunks = true,
 };
 
-static const struct of_device_id atmel_pmecc_legacy_match[] = {
+static const struct of_device_id __maybe_unused atmel_pmecc_legacy_match[] = {
        { .compatible = "atmel,sama5d4-nand", &sama5d4_caps },
        { .compatible = "atmel,sama5d2-nand", &sama5d2_caps },
        { /* sentinel */ }
index f75929783b9419ee4827bedbe89c4e97288e59c4..7c0f02069ea07903626fbe86126bbd733a7bc0c8 100644 (file)
@@ -2914,7 +2914,7 @@ const struct dev_pm_ops brcmnand_pm_ops = {
 };
 EXPORT_SYMBOL_GPL(brcmnand_pm_ops);
 
-static const struct of_device_id brcmnand_of_match[] = {
+static const struct of_device_id __maybe_unused brcmnand_of_match[] = {
        { .compatible = "brcm,brcmnand-v2.1" },
        { .compatible = "brcm,brcmnand-v2.2" },
        { .compatible = "brcm,brcmnand-v4.0" },