ALSA: hda: cs35l41: Drop wrong use of ACPI_PTR()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 12 Jul 2022 15:35:18 +0000 (18:35 +0300)
committerTakashi Iwai <tiwai@suse.de>
Wed, 13 Jul 2022 06:28:13 +0000 (08:28 +0200)
ACPI_PTR() is more harmful than helpful. For example, in this case
if CONFIG_ACPI=n, the ID table left unused which is not what we want.

Instead of adding ifdeffery or attribute here and there, drop ACPI_PTR().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220712153519.35692-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda_i2c.c
sound/pci/hda/cs35l41_hda_spi.c

index ec626e0..df39fc7 100644 (file)
@@ -6,9 +6,9 @@
 //
 // Author: Lucas Tanure <tanureal@opensource.cirrus.com>
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
-#include <linux/acpi.h>
 
 #include "cs35l41_hda.h"
 
@@ -43,19 +43,17 @@ static const struct i2c_device_id cs35l41_hda_i2c_id[] = {
        {}
 };
 
-#ifdef CONFIG_ACPI
 static const struct acpi_device_id cs35l41_acpi_hda_match[] = {
        {"CLSA0100", 0 },
        {"CSC3551", 0 },
-       { },
+       {}
 };
 MODULE_DEVICE_TABLE(acpi, cs35l41_acpi_hda_match);
-#endif
 
 static struct i2c_driver cs35l41_i2c_driver = {
        .driver = {
                .name           = "cs35l41-hda",
-               .acpi_match_table = ACPI_PTR(cs35l41_acpi_hda_match),
+               .acpi_match_table = cs35l41_acpi_hda_match,
        },
        .id_table       = cs35l41_hda_i2c_id,
        .probe          = cs35l41_hda_i2c_probe,
index 3a1472e..2f5afad 100644 (file)
@@ -6,7 +6,7 @@
 //
 // Author: Lucas Tanure <tanureal@opensource.cirrus.com>
 
-#include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
 
@@ -39,18 +39,16 @@ static const struct spi_device_id cs35l41_hda_spi_id[] = {
        {}
 };
 
-#ifdef CONFIG_ACPI
 static const struct acpi_device_id cs35l41_acpi_hda_match[] = {
        { "CSC3551", 0 },
-       {},
+       {}
 };
 MODULE_DEVICE_TABLE(acpi, cs35l41_acpi_hda_match);
-#endif
 
 static struct spi_driver cs35l41_spi_driver = {
        .driver = {
                .name           = "cs35l41-hda",
-               .acpi_match_table = ACPI_PTR(cs35l41_acpi_hda_match),
+               .acpi_match_table = cs35l41_acpi_hda_match,
        },
        .id_table       = cs35l41_hda_spi_id,
        .probe          = cs35l41_hda_spi_probe,