diff mbox series

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

Message ID 20230311111658.251951-5-krzysztof.kozlowski@linaro.org
State Accepted
Headers show
Series [1/5] i2c: mt65xx: drop of_match_ptr for ID table | expand

Commit Message

Krzysztof Kozlowski March 11, 2023, 11:16 a.m. UTC
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 <krzysztof.kozlowski@linaro.org>
---
 drivers/i2c/busses/i2c-synquacer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck March 11, 2023, 4:35 p.m. UTC | #1
On Sat, Mar 11, 2023 at 3:17 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> 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 <krzysztof.kozlowski@linaro.org>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>  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
>
Wolfram Sang March 29, 2023, 6:56 p.m. UTC | #2
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 <krzysztof.kozlowski@linaro.org>

Applied to for-next, thanks!
diff mbox series

Patch

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 */ }
 };