linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: arizona: Split of_match table into I2C and SPI versions
@ 2021-09-28 13:11 Charles Keepax
  2021-09-28 13:13 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Keepax @ 2021-09-28 13:11 UTC (permalink / raw)
  To: lee.jones; +Cc: broonie, linux-kernel, patches

The Arizona driver has both some devices which only have an I2C
interface and some which only have a SPI interface. Currently both
of these share an of_match table, but this means inapproriate
compatibles are available for each interface. Apart from being
rather untidy, after recent changes this will also cause a warning
on boot for the SPI subsystem. Tidy this up by creating a table
for each interface listing only the appropriate compatibles.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 drivers/mfd/arizona-core.c | 13 -------------
 drivers/mfd/arizona-i2c.c  | 14 +++++++++++++-
 drivers/mfd/arizona-spi.c  | 13 ++++++++++++-
 drivers/mfd/arizona.h      |  2 --
 4 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 9323b1e3a69ef..cbf1dd90b70d5 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -845,19 +845,6 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
 
 	return 0;
 }
-
-const struct of_device_id arizona_of_match[] = {
-	{ .compatible = "wlf,wm5102", .data = (void *)WM5102 },
-	{ .compatible = "wlf,wm5110", .data = (void *)WM5110 },
-	{ .compatible = "wlf,wm8280", .data = (void *)WM8280 },
-	{ .compatible = "wlf,wm8997", .data = (void *)WM8997 },
-	{ .compatible = "wlf,wm8998", .data = (void *)WM8998 },
-	{ .compatible = "wlf,wm1814", .data = (void *)WM1814 },
-	{ .compatible = "wlf,wm1831", .data = (void *)WM1831 },
-	{ .compatible = "cirrus,cs47l24", .data = (void *)CS47L24 },
-	{},
-};
-EXPORT_SYMBOL_GPL(arizona_of_match);
 #else
 static inline int arizona_of_get_core_pdata(struct arizona *arizona)
 {
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index 5e83b730c4ced..3ed810e81f631 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -104,11 +104,23 @@ static const struct i2c_device_id arizona_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
 
+#ifdef CONFIG_OF
+const struct of_device_id arizona_i2c_of_match[] = {
+	{ .compatible = "wlf,wm5102", .data = (void *)WM5102 },
+	{ .compatible = "wlf,wm5110", .data = (void *)WM5110 },
+	{ .compatible = "wlf,wm8280", .data = (void *)WM8280 },
+	{ .compatible = "wlf,wm8997", .data = (void *)WM8997 },
+	{ .compatible = "wlf,wm8998", .data = (void *)WM8998 },
+	{ .compatible = "wlf,wm1814", .data = (void *)WM1814 },
+	{},
+};
+#endif
+
 static struct i2c_driver arizona_i2c_driver = {
 	.driver = {
 		.name	= "arizona",
 		.pm	= &arizona_pm_ops,
-		.of_match_table	= of_match_ptr(arizona_of_match),
+		.of_match_table	= of_match_ptr(arizona_i2c_of_match),
 	},
 	.probe		= arizona_i2c_probe,
 	.remove		= arizona_i2c_remove,
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index aa1d6f94ae532..9fe06dda37829 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -225,11 +225,22 @@ static const struct spi_device_id arizona_spi_ids[] = {
 };
 MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
 
+#ifdef CONFIG_OF
+const struct of_device_id arizona_spi_of_match[] = {
+	{ .compatible = "wlf,wm5102", .data = (void *)WM5102 },
+	{ .compatible = "wlf,wm5110", .data = (void *)WM5110 },
+	{ .compatible = "wlf,wm8280", .data = (void *)WM8280 },
+	{ .compatible = "wlf,wm1831", .data = (void *)WM1831 },
+	{ .compatible = "cirrus,cs47l24", .data = (void *)CS47L24 },
+	{},
+};
+#endif
+
 static struct spi_driver arizona_spi_driver = {
 	.driver = {
 		.name	= "arizona",
 		.pm	= &arizona_pm_ops,
-		.of_match_table	= of_match_ptr(arizona_of_match),
+		.of_match_table	= of_match_ptr(arizona_spi_of_match),
 		.acpi_match_table = ACPI_PTR(arizona_acpi_match),
 	},
 	.probe		= arizona_spi_probe,
diff --git a/drivers/mfd/arizona.h b/drivers/mfd/arizona.h
index 801cbbcd71cb5..66d6092d08515 100644
--- a/drivers/mfd/arizona.h
+++ b/drivers/mfd/arizona.h
@@ -28,8 +28,6 @@ extern const struct regmap_config wm8998_i2c_regmap;
 
 extern const struct dev_pm_ops arizona_pm_ops;
 
-extern const struct of_device_id arizona_of_match[];
-
 extern const struct regmap_irq_chip wm5102_aod;
 extern const struct regmap_irq_chip wm5102_irq;
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: arizona: Split of_match table into I2C and SPI versions
  2021-09-28 13:11 [PATCH] mfd: arizona: Split of_match table into I2C and SPI versions Charles Keepax
@ 2021-09-28 13:13 ` Mark Brown
  2021-09-28 13:36   ` Charles Keepax
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2021-09-28 13:13 UTC (permalink / raw)
  To: Charles Keepax; +Cc: lee.jones, linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Tue, Sep 28, 2021 at 02:11:45PM +0100, Charles Keepax wrote:

> rather untidy, after recent changes this will also cause a warning
> on boot for the SPI subsystem. Tidy this up by creating a table
> for each interface listing only the appropriate compatibles.

> Fixes: 96c8395e2166 ("spi: Revert modalias changes")

This has been an issue for a long time regardless of what the SPI core
does, and if you're trying to identify the patch that introduced the
warning that's not it.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: arizona: Split of_match table into I2C and SPI versions
  2021-09-28 13:13 ` Mark Brown
@ 2021-09-28 13:36   ` Charles Keepax
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2021-09-28 13:36 UTC (permalink / raw)
  To: Mark Brown; +Cc: lee.jones, linux-kernel, patches

On Tue, Sep 28, 2021 at 02:13:26PM +0100, Mark Brown wrote:
> On Tue, Sep 28, 2021 at 02:11:45PM +0100, Charles Keepax wrote:
> 
> > rather untidy, after recent changes this will also cause a warning
> > on boot for the SPI subsystem. Tidy this up by creating a table
> > for each interface listing only the appropriate compatibles.
> 
> > Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> 
> This has been an issue for a long time regardless of what the SPI core
> does, and if you're trying to identify the patch that introduced the
> warning that's not it.

Apologies misunderstood you last email. Probably simplest to just
drop the fixes, otherwise I guess we are talking about multiple
patches that introduced each of the affected codecs. I guess
fixes is more for stuff that needs backported as well, and since
things work fine this probably doesn't need to go to stable.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-28 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 13:11 [PATCH] mfd: arizona: Split of_match table into I2C and SPI versions Charles Keepax
2021-09-28 13:13 ` Mark Brown
2021-09-28 13:36   ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).