From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>,
Lucas Tanure <tanureal@opensource.cirrus.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
James Schulman <james.schulman@cirrus.com>,
David Rhodes <david.rhodes@cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH v2 3/4] ALSA: hda: cs35l41: Drop wrong use of ACPI_PTR()
Date: Tue, 12 Jul 2022 18:35:18 +0300 [thread overview]
Message-ID: <20220712153519.35692-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220712153519.35692-1-andriy.shevchenko@linux.intel.com>
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>
---
v2: no changes
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 ec626e0fbedc..df39fc76e6be 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@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,
diff --git a/sound/pci/hda/cs35l41_hda_spi.c b/sound/pci/hda/cs35l41_hda_spi.c
index 3a1472e1bc24..2f5afad3719e 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@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,
--
2.35.1
next prev parent reply other threads:[~2022-07-12 15:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 15:35 [PATCH v2 1/4] ALSA: hda: cs35l41: Don't dereference fwnode handle Andy Shevchenko
2022-07-12 15:35 ` [PATCH v2 2/4] ALSA: hda: cs35l41: Allow compilation test on non-ACPI configurations Andy Shevchenko
2022-07-12 15:35 ` Andy Shevchenko [this message]
2022-07-12 15:35 ` [PATCH v2 4/4] ALSA: hda: cs35l41: Consolidate selections under SND_HDA_SCODEC_CS35L41 Andy Shevchenko
2022-07-13 6:28 ` [PATCH v2 1/4] ALSA: hda: cs35l41: Don't dereference fwnode handle Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220712153519.35692-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=david.rhodes@cirrus.com \
--cc=james.schulman@cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=tanureal@opensource.cirrus.com \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox