Re: [PATCH 2/3] ASoC: adau1977-spi: drop __maybe_unused and of_match_ptr()
From: Nuno Sá
Date: Mon Sep 14 2026 - 09:27:13 EST
On Mon, Sep 14, 2026 at 12:12:36PM +0200, Alvin Šipraga wrote:
> Since commit 5ab23c7923a1 ("modpost: Create modalias for builtin
> modules") MODULE_DEVICE_TABLE() is enough to reference a match table and
> the data isn't discarded by the linker even when the driver is built-in
> and CONFIG_OF is disabled. Drop the of_match_ptr() wrapping so that OF
> matching keeps working regardless of CONFIG_OF. This also means we can
> drop __maybe_unused since it's always used.
>
> The entries in adau1977_spi_of_match were also erroneously indented with
> spaces - replace the indentation with tabs to conform with coding style.
>
> Signed-off-by: Alvin Šipraga <alvin.sipraga@xxxxxxxxxx>
> ---
Small nit:
> sound/soc/codecs/adau1977-spi.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/codecs/adau1977-spi.c b/sound/soc/codecs/adau1977-spi.c
> index 878cde9d1014..c98da5ba9e9e 100644
> --- a/sound/soc/codecs/adau1977-spi.c
> +++ b/sound/soc/codecs/adau1977-spi.c
> @@ -53,18 +53,18 @@ static const struct spi_device_id adau1977_spi_ids[] = {
> };
> MODULE_DEVICE_TABLE(spi, adau1977_spi_ids);
>
> -static const struct of_device_id adau1977_spi_of_match[] __maybe_unused = {
> - { .compatible = "adi,adau1977" },
> - { .compatible = "adi,adau1978" },
> - { .compatible = "adi,adau1979" },
> - { },
> +static const struct of_device_id adau1977_spi_of_match[] = {
> + { .compatible = "adi,adau1977" },
> + { .compatible = "adi,adau1978" },
> + { .compatible = "adi,adau1979" },
> + { },
While at it, you cloud drop the comma. We have the null terminator after
all. Also applies on patch 3
- Nuno Sá
> };
> MODULE_DEVICE_TABLE(of, adau1977_spi_of_match);
>
> static struct spi_driver adau1977_spi_driver = {
> .driver = {
> .name = "adau1977",
> - .of_match_table = of_match_ptr(adau1977_spi_of_match),
> + .of_match_table = adau1977_spi_of_match,
> },
> .probe = adau1977_spi_probe,
> .id_table = adau1977_spi_ids,
>
> --
> 2.54.0
>