[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220711095219.36915-3-andriy.shevchenko@linux.intel.com>
Date: Mon, 11 Jul 2022 12:52:18 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Takashi Iwai <tiwai@...e.de>,
Lucas Tanure <tanureal@...nsource.cirrus.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
patches@...nsource.cirrus.com
Cc: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
James Schulman <james.schulman@...rus.com>,
David Rhodes <david.rhodes@...rus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>
Subject: [PATCH v1 3/4] ALSA: hda: cs35l41: Drop wrong use of ACPI_PTR()
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@...ux.intel.com>
---
sound/pci/hda/cs35l41_hda_i2c.c | 8 +++-----
sound/pci/hda/cs35l41_hda_spi.c | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/sound/pci/hda/cs35l41_hda_i2c.c b/sound/pci/hda/cs35l41_hda_i2c.c
index e810b278fb91..5cfb5aac37ac 100644
--- a/sound/pci/hda/cs35l41_hda_i2c.c
+++ b/sound/pci/hda/cs35l41_hda_i2c.c
@@ -6,9 +6,9 @@
//
// Author: Lucas Tanure <tanureal@...nsource.cirrus.com>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/i2c.h>
-#include <linux/acpi.h>
#include "cs35l41_hda.h"
@@ -42,19 +42,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,
diff --git a/sound/pci/hda/cs35l41_hda_spi.c b/sound/pci/hda/cs35l41_hda_spi.c
index 22e088f28438..c9a61675c4fd 100644
--- a/sound/pci/hda/cs35l41_hda_spi.c
+++ b/sound/pci/hda/cs35l41_hda_spi.c
@@ -6,7 +6,7 @@
//
// Author: Lucas Tanure <tanureal@...nsource.cirrus.com>
-#include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
@@ -38,18 +38,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,
--
2.35.1
Powered by blists - more mailing lists