Commit e02dacd3 authored by Miquel Raynal's avatar Miquel Raynal
Browse files

mtd: rawnand: Fix misuses of of_match_node()



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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/linux-mtd/20220127110802.1064963-1-miquel.raynal@bootlin.com
parent 3f26d1bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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 */ }
+1 −1
Original line number Diff line number Diff line
@@ -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" },