2023-03-11 11:20:47

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [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=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/i2c/busses/i2c-mt65xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 43dd966d5ef5..59eaefe999b1 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -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



2023-03-11 11:20:50

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [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=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/i2c/busses/i2c-owl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-owl.c b/drivers/i2c/busses/i2c-owl.c
index 98882fe4e965..99ddd8894964 100644
--- a/drivers/i2c/busses/i2c-owl.c
+++ b/drivers/i2c/busses/i2c-owl.c
@@ -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


2023-03-11 11:20:55

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 3/5] i2c: xiic: hide OF related data for COMPILE_TEST

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=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/i2c/busses/i2c-xiic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index dbb792fc197e..806b447055fb 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -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


2023-03-11 11:20:58

by Krzysztof Kozlowski

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

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=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/i2c/busses/i2c-cros-ec-tunnel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
index 4e787dc709f9..8b3ff5bb14d8 100644
--- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
+++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
@@ -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


2023-03-11 11:21:00

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 5/5] i2c: synquacer: mark OF related data as maybe unused

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=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/i2c/busses/i2c-synquacer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
index e4026c5416b1..50d19cf99a03 100644
--- a/drivers/i2c/busses/i2c-synquacer.c
+++ b/drivers/i2c/busses/i2c-synquacer.c
@@ -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


2023-03-11 16:04:57

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 1/5] i2c: mt65xx: drop of_match_ptr for ID table

On Sat, Mar 11, 2023 at 3:17 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/i2c/busses/i2c-mt65xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
> index 43dd966d5ef5..59eaefe999b1 100644
> --- a/drivers/i2c/busses/i2c-mt65xx.c
> +++ b/drivers/i2c/busses/i2c-mt65xx.c
> @@ -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
>

2023-03-11 16:05:40

by Guenter Roeck

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

On Sat, Mar 11, 2023 at 3:17 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/i2c/busses/i2c-owl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-owl.c b/drivers/i2c/busses/i2c-owl.c
> index 98882fe4e965..99ddd8894964 100644
> --- a/drivers/i2c/busses/i2c-owl.c
> +++ b/drivers/i2c/busses/i2c-owl.c
> @@ -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
>

2023-03-11 16:09:52

by Guenter Roeck

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

On Sat, Mar 11, 2023 at 3:17 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/i2c/busses/i2c-cros-ec-tunnel.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> index 4e787dc709f9..8b3ff5bb14d8 100644
> --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> @@ -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
>

2023-03-11 16:35:07

by Guenter Roeck

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

On Sat, Mar 11, 2023 at 3:17 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/i2c/busses/i2c-xiic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index dbb792fc197e..806b447055fb 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -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
>

2023-03-11 16:35:49

by Guenter Roeck

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

On Sat, Mar 11, 2023 at 3:17 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> drivers/i2c/busses/i2c-synquacer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
> index e4026c5416b1..50d19cf99a03 100644
> --- a/drivers/i2c/busses/i2c-synquacer.c
> +++ b/drivers/i2c/busses/i2c-synquacer.c
> @@ -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
>

Subject: Re: [PATCH 1/5] i2c: mt65xx: drop of_match_ptr for ID table

Il 11/03/23 12:16, Krzysztof Kozlowski ha scritto:
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>



2023-03-16 19:57:21

by Wolfram Sang

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

On Sat, Mar 11, 2023 at 12:16:55PM +0100, Krzysztof Kozlowski wrote:
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (519.00 B)
signature.asc (833.00 B)
Download all attachments

2023-03-16 19:57:27

by Wolfram Sang

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

On Sat, Mar 11, 2023 at 12:16:57PM +0100, Krzysztof Kozlowski wrote:
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (413.00 B)
signature.asc (833.00 B)
Download all attachments

2023-03-16 19:57:54

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 1/5] i2c: mt65xx: drop of_match_ptr for ID table

On Sat, Mar 11, 2023 at 12:16:54PM +0100, Krzysztof Kozlowski wrote:
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (522.00 B)
signature.asc (833.00 B)
Download all attachments

2023-03-29 19:02:47

by Wolfram Sang

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

On Sat, Mar 11, 2023 at 12:16:58PM +0100, Krzysztof Kozlowski wrote:
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (402.00 B)
signature.asc (849.00 B)
Download all attachments

2023-03-29 19:03:07

by Wolfram Sang

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

On Sat, Mar 11, 2023 at 12:16:56PM +0100, Krzysztof Kozlowski wrote:
> 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=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (387.00 B)
signature.asc (849.00 B)
Download all attachments