Skip to contentSkip to conversation

i2c: mt65xx: drop of_match_ptr for ID table

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

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

PATCH 1/5 i2c: mt65xx: 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/i2c/busses/i2c-mt65xx.c:514:34: error: ‘mtk_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/i2c/busses/i2c-mt65xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mt65xx.c +1 -1
index 43dd966d5ef5..59eaefe999b1 100644
@@ -1546,7 +1546,7 @@ static struct platform_driver mtk_i2c_driver = {
 	.driver = {
 		.name = I2C_DRV_NAME,
 		.pm = &mtk_i2c_pm,
-		.of_match_table = of_match_ptr(mtk_i2c_of_match),
+		.of_match_table = mtk_i2c_of_match,
 	},
 };
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/5 i2c: owl: 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/i2c/busses/i2c-owl.c:510:34: error: ‘owl_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/i2c/busses/i2c-owl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-owl.c +1 -1
index 98882fe4e965..99ddd8894964 100644
@@ -519,7 +519,7 @@ static struct platform_driver owl_i2c_driver = {
 	.probe		= owl_i2c_probe,
 	.driver		= {
 		.name	= "owl-i2c",
-		.of_match_table = of_match_ptr(owl_i2c_of_match),
+		.of_match_table = owl_i2c_of_match,
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
Signature · 1 line
2.34.1
Reviewed-by on v1 2/5
#2 lore raw

Re: [PATCH 2/5] i2c: owl: drop of_match_ptr for ID table

Quoted 8 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/i2c/busses/i2c-owl.c:510:34: error: ‘owl_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Quoted 20 lines
---
 drivers/i2c/busses/i2c-owl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-owl.c +1 -2
index 98882fe4e965..99ddd8894964 100644
@@ -519,7 +519,7 @@ static struct platform_driver owl_i2c_driver = {
        .probe          = owl_i2c_probe,
        .driver         = {
                .name   = "owl-i2c",
-               .of_match_table = of_match_ptr(owl_i2c_of_match),
+               .of_match_table = owl_i2c_of_match,
                .probe_type = PROBE_PREFER_ASYNCHRONOUS,
        },
 };
--

2.34.1

Applied
#3 lore raw

Re: [PATCH 2/5] i2c: owl: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski
Quoted 7 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/i2c/busses/i2c-owl.c:510:34: error: ‘owl_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Applied to for-next, thanks!

#4 lore raw

PATCH 3/5 i2c: xiic: hide OF related data for COMPILE_TEST

In reply to Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-xiic.c:1202:39: error: ‘xiic_2_00’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/i2c/busses/i2c-xiic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-xiic.c +1 -1
index dbb792fc197e..806b447055fb 100644
@@ -1199,11 +1199,11 @@ static const struct i2c_adapter xiic_adapter = {
 	.algo = &xiic_algorithm,
 };
 
+#if defined(CONFIG_OF)
 static const struct xiic_version_data xiic_2_00 = {
 	.quirks = DYNAMIC_MODE_READ_BROKEN_BIT,
 };
 
-#if defined(CONFIG_OF)
 static const struct of_device_id xiic_of_match[] = {
 	{ .compatible = "xlnx,xps-iic-2.00.a", .data = &xiic_2_00 },
 	{ .compatible = "xlnx,axi-iic-2.1", },
Signature · 1 line
2.34.1
Reviewed-by on v1 3/5
#5 lore raw

Re: [PATCH 3/5] i2c: xiic: hide OF related data for COMPILE_TEST

Quoted 7 lines · Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-xiic.c:1202:39: error: ‘xiic_2_00’ defined but not used [-Werror=unused-const-variable=]

Quoted 24 lines
---
 drivers/i2c/busses/i2c-xiic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-xiic.c +1 -2
index dbb792fc197e..806b447055fb 100644
@@ -1199,11 +1199,11 @@ static const struct i2c_adapter xiic_adapter = {
        .algo = &xiic_algorithm,
 };
 
+#if defined(CONFIG_OF)
 static const struct xiic_version_data xiic_2_00 = {
        .quirks = DYNAMIC_MODE_READ_BROKEN_BIT,
 };
 
-#if defined(CONFIG_OF)
 static const struct of_device_id xiic_of_match[] = {
        { .compatible = "xlnx,xps-iic-2.00.a", .data = &xiic_2_00 },
        { .compatible = "xlnx,axi-iic-2.1", },
--

2.34.1

Applied
#6 lore raw

Re: [PATCH 3/5] i2c: xiic: hide OF related data for COMPILE_TEST

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-xiic.c:1202:39: error: ‘xiic_2_00’ defined but not used [-Werror=unused-const-variable=]

Applied to for-next, thanks!

#7 lore raw

PATCH 4/5 i2c: cros-ec-tunnel: Mark ACPI and OF related data as maybe unused

In reply to Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-cros-ec-tunnel.c:295:34: error: ‘cros_ec_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/i2c/busses/i2c-cros-ec-tunnel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-cros-ec-tunnel.c +2 -2
index 4e787dc709f9..8b3ff5bb14d8 100644
@@ -292,13 +292,13 @@ static int ec_i2c_remove(struct platform_device *dev)
 	return 0;
 }
 
-static const struct of_device_id cros_ec_i2c_of_match[] = {
+static const struct of_device_id cros_ec_i2c_of_match[] __maybe_unused = {
 	{ .compatible = "google,cros-ec-i2c-tunnel" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match);
 
-static const struct acpi_device_id cros_ec_i2c_tunnel_acpi_id[] = {
+static const struct acpi_device_id cros_ec_i2c_tunnel_acpi_id[] __maybe_unused = {
 	{ "GOOG0012", 0 },
 	{ }
 };
Signature · 1 line
2.34.1
Reviewed-by on v1 4/5
#8 lore raw

Re: [PATCH 4/5] i2c: cros-ec-tunnel: Mark ACPI and OF related data as maybe unused

Quoted 7 lines · Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-cros-ec-tunnel.c:295:34: error: ‘cros_ec_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Quoted 27 lines
---
 drivers/i2c/busses/i2c-cros-ec-tunnel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-cros-ec-tunnel.c +2 -3
index 4e787dc709f9..8b3ff5bb14d8 100644
@@ -292,13 +292,13 @@ static int ec_i2c_remove(struct platform_device *dev)
        return 0;
 }
 
-static const struct of_device_id cros_ec_i2c_of_match[] = {
+static const struct of_device_id cros_ec_i2c_of_match[] __maybe_unused = {
        { .compatible = "google,cros-ec-i2c-tunnel" },
        {},
 };
 MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match);
 
-static const struct acpi_device_id cros_ec_i2c_tunnel_acpi_id[] = {
+static const struct acpi_device_id cros_ec_i2c_tunnel_acpi_id[] __maybe_unused = {
        { "GOOG0012", 0 },
        { }
 };
--

2.34.1

Applied
#9 lore raw

Re: [PATCH 4/5] i2c: cros-ec-tunnel: Mark ACPI and OF related data as maybe unused

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-cros-ec-tunnel.c:295:34: error: ‘cros_ec_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Applied to for-next, thanks!

#10 lore raw

PATCH 5/5 i2c: synquacer: mark OF related data as maybe unused

In reply to Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-synquacer.c:632:34: error: ‘synquacer_i2c_dt_ids’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/i2c/busses/i2c-synquacer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-synquacer.c +1 -1
index e4026c5416b1..50d19cf99a03 100644
@@ -629,7 +629,7 @@ static int synquacer_i2c_remove(struct platform_device *pdev)
 	return 0;
 };
 
-static const struct of_device_id synquacer_i2c_dt_ids[] = {
+static const struct of_device_id synquacer_i2c_dt_ids[] __maybe_unused = {
 	{ .compatible = "socionext,synquacer-i2c" },
 	{ /* sentinel */ }
 };
Signature · 1 line
2.34.1
Reviewed-by on v1 5/5
#11 lore raw

Re: [PATCH 5/5] i2c: synquacer: mark OF related data as maybe unused

Quoted 7 lines · Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-synquacer.c:632:34: error: ‘synquacer_i2c_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Quoted 20 lines
---
 drivers/i2c/busses/i2c-synquacer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-synquacer.c +1 -2
index e4026c5416b1..50d19cf99a03 100644
@@ -629,7 +629,7 @@ static int synquacer_i2c_remove(struct platform_device *pdev)
        return 0;
 };
 
-static const struct of_device_id synquacer_i2c_dt_ids[] = {
+static const struct of_device_id synquacer_i2c_dt_ids[] __maybe_unused = {
        { .compatible = "socionext,synquacer-i2c" },
        { /* sentinel */ }
 };
--

2.34.1

Applied
#12 lore raw

Re: [PATCH 5/5] i2c: synquacer: mark OF related data as maybe unused

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski

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

drivers/i2c/busses/i2c-synquacer.c:632:34: error: ‘synquacer_i2c_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Applied to for-next, thanks!

Reviewed-by on v1 1/5
#13 lore raw
In reply to Krzysztof Kozlowski
Quoted 8 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/i2c/busses/i2c-mt65xx.c:514:34: error: ‘mtk_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Quoted 20 lines
---
 drivers/i2c/busses/i2c-mt65xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mt65xx.c +1 -2
index 43dd966d5ef5..59eaefe999b1 100644
@@ -1546,7 +1546,7 @@ static struct platform_driver mtk_i2c_driver = {
        .driver = {
                .name = I2C_DRV_NAME,
                .pm = &mtk_i2c_pm,
-               .of_match_table = of_match_ptr(mtk_i2c_of_match),
+               .of_match_table = mtk_i2c_of_match,
        },
 };
 
--

2.34.1

maintainer Reviewed-by on v1 1/5
#14 lore raw
In reply to Krzysztof Kozlowski

Il 11/03/23 12:16, Krzysztof Kozlowski ha scritto:

Quoted 7 lines

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/i2c/busses/i2c-mt65xx.c:514:34: error: ‘mtk_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Applied
#15 lore raw
In reply to Krzysztof Kozlowski
Quoted 7 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/i2c/busses/i2c-mt65xx.c:514:34: error: ‘mtk_i2c_of_match’ defined but not used [-Werror=unused-const-variable=]

Applied to for-next, thanks!