Skip to contentSkip to conversation

mfd: atmel-smc: Mark OF related data as maybe unused

PATCH Applied Krzysztof Kozlowski 2 participants 4 messages Mar 11, 2023 – Mar 16, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mfd: atmel-smc: Mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/mfd/atmel-smc.c:326:34: error: ‘atmel_smc_ids’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/mfd/atmel-smc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/atmel-smc.c +1 -1
index f3bad2b52f17..e560066e5885 100644
@@ -323,7 +323,7 @@ static const struct atmel_hsmc_reg_layout sama5d2_reg_layout = {
 	.timing_regs_offset = 0x700,
 };
 
-static const struct of_device_id atmel_smc_ids[] = {
+static const struct of_device_id atmel_smc_ids[] __maybe_unused = {
 	{ .compatible = "atmel,at91sam9260-smc", .data = NULL },
 	{ .compatible = "atmel,sama5d3-smc", .data = &sama5d3_reg_layout },
 	{ .compatible = "atmel,sama5d2-smc", .data = &sama5d2_reg_layout },
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 mfd: atc260x-i2c: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/mfd/atc260x-i2c.c:44:34: error: ‘atc260x_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/mfd/atc260x-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/atc260x-i2c.c +1 -1
index 19e248ed7966..8e1491167160 100644
@@ -51,7 +51,7 @@ MODULE_DEVICE_TABLE(of, atc260x_i2c_of_match);
 static struct i2c_driver atc260x_i2c_driver = {
 	.driver = {
 		.name = "atc260x",
-		.of_match_table	= of_match_ptr(atc260x_i2c_of_match),
+		.of_match_table	= atc260x_i2c_of_match,
 	},
 	.probe_new = atc260x_i2c_probe,
 };
Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] mfd: atc260x-i2c: drop of_match_ptr for ID table

Quoted 10 lines · Krzysztof Kozlowski

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/mfd/atc260x-i2c.c:44:34: error: ‘atc260x_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/mfd/atc260x-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

--
Lee Jones [李琼斯]

maintainer Applied
#3 lore raw
In reply to Krzysztof Kozlowski
Quoted 9 lines · Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/mfd/atmel-smc.c:326:34: error: ‘atmel_smc_ids’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/mfd/atmel-smc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

--
Lee Jones [李琼斯]