diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2023-03-11 01:28:57 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-13 17:09:15 +0300 |
commit | edfa970370a759c2c6a38b2884887937b1aea552 (patch) | |
tree | 188bc02469225f06bff119834e978a264884a893 /drivers/spi/spi-rspi.c | |
parent | 833f43308234600e934e9c6fa70fd8b7eebc632b (diff) | |
download | linux-edfa970370a759c2c6a38b2884887937b1aea552.tar.xz |
spi: rspi: Mark OF related data as maybe unused
Driver can match via ID or OF ID table, thus several OF-related methods
will be unused. Mark the OF structures as __maybe_unused so compiler
can drop them:
drivers/spi/spi-rspi.c:1203:29: error: ‘qspi_ops’ defined but not used [-Werror=unused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230310222857.315629-16-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rspi.c')
-rw-r--r-- | drivers/spi/spi-rspi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index f50a39efaf96..08ceebbaf69b 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -1190,7 +1190,7 @@ static const struct spi_ops rspi_ops = { .num_hw_ss = 2, }; -static const struct spi_ops rspi_rz_ops = { +static const struct spi_ops rspi_rz_ops __maybe_unused = { .set_config_register = rspi_rz_set_config_register, .transfer_one = rspi_rz_transfer_one, .min_div = 2, @@ -1200,7 +1200,7 @@ static const struct spi_ops rspi_rz_ops = { .num_hw_ss = 1, }; -static const struct spi_ops qspi_ops = { +static const struct spi_ops qspi_ops __maybe_unused = { .set_config_register = qspi_set_config_register, .transfer_one = qspi_transfer_one, .extra_mode_bits = SPI_TX_DUAL | SPI_TX_QUAD | @@ -1212,8 +1212,7 @@ static const struct spi_ops qspi_ops = { .num_hw_ss = 1, }; -#ifdef CONFIG_OF -static const struct of_device_id rspi_of_match[] = { +static const struct of_device_id rspi_of_match[] __maybe_unused = { /* RSPI on legacy SH */ { .compatible = "renesas,rspi", .data = &rspi_ops }, /* RSPI on RZ/A1H */ @@ -1225,6 +1224,7 @@ static const struct of_device_id rspi_of_match[] = { MODULE_DEVICE_TABLE(of, rspi_of_match); +#ifdef CONFIG_OF static void rspi_reset_control_assert(void *data) { reset_control_assert(data); |