All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Match data improvements for wm8580 driver
@ 2023-08-31 20:14 Biju Das
  2023-08-31 20:14 ` [PATCH v3 1/2] ASoC: wm8580: Simplify probe() Biju Das
  2023-08-31 20:14 ` [PATCH v3 2/2] ASoC: wm8580: Move OF table Biju Das
  0 siblings, 2 replies; 6+ messages in thread
From: Biju Das @ 2023-08-31 20:14 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Biju Das, Liam Girdwood, Mark Brown, Charles Keepax,
	Andy Shevchenko, Uwe Kleine-König, patches, alsa-devel,
	linux-kernel

This patch series aims to add match data improvements for wm8580 driver.

This patch series is only compile tested.

v2->v3:
 * Added Rb tag from Andy.
 * Restored OF table postion and moved in patch#2
 * Moved OF table near to the user.
v1->v2:
 * Added Ack from Charles Keepax.
 * Removed comma in the terminator entry.
 * Restored original error code -EINVAL

Biju Das (2):
  ASoC: wm8580: Simplify probe()
  ASoC: wm8580: Move OF table

 sound/soc/codecs/wm8580.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

-- 
2.25.1


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

* [PATCH v3 1/2] ASoC: wm8580: Simplify probe()
  2023-08-31 20:14 [PATCH v3 0/2] Match data improvements for wm8580 driver Biju Das
@ 2023-08-31 20:14 ` Biju Das
  2023-08-31 20:14 ` [PATCH v3 2/2] ASoC: wm8580: Move OF table Biju Das
  1 sibling, 0 replies; 6+ messages in thread
From: Biju Das @ 2023-08-31 20:14 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Biju Das, Liam Girdwood, Mark Brown, Charles Keepax,
	Andy Shevchenko, Uwe Kleine-König, patches, alsa-devel,
	linux-kernel

Simplify probe() by replacing of_match_device->i2c_get_match_data()
and extend matching support for ID table.

While at it, remove comma in the terminator entry and simplify probe()
by replacing dev_err()->dev_err_probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2->v3:
 * Added Rb tag from Andy.
 * Restored OF table postion and moved in patch#2
v1->v2:
 * Added Ack from Charles Keepax.
 * Removed comma in the terminator entry.
 * Restored original error code -EINVAL
---
 sound/soc/codecs/wm8580.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 6d22f7d40ec2..826c39ec4a1e 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -997,7 +997,6 @@ MODULE_DEVICE_TABLE(of, wm8580_of_match);
 
 static int wm8580_i2c_probe(struct i2c_client *i2c)
 {
-	const struct of_device_id *of_id;
 	struct wm8580_priv *wm8580;
 	int ret, i;
 
@@ -1022,14 +1021,9 @@ static int wm8580_i2c_probe(struct i2c_client *i2c)
 
 	i2c_set_clientdata(i2c, wm8580);
 
-	of_id = of_match_device(wm8580_of_match, &i2c->dev);
-	if (of_id)
-		wm8580->drvdata = of_id->data;
-
-	if (!wm8580->drvdata) {
-		dev_err(&i2c->dev, "failed to find driver data\n");
-		return -EINVAL;
-	}
+	wm8580->drvdata = i2c_get_match_data(i2c);
+	if (!wm8580->drvdata)
+		return dev_err_probe(&i2c->dev, -EINVAL, "failed to find driver data\n");
 
 	ret = devm_snd_soc_register_component(&i2c->dev,
 			&soc_component_dev_wm8580, wm8580_dai, ARRAY_SIZE(wm8580_dai));
-- 
2.25.1


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

* [PATCH v3 2/2] ASoC: wm8580: Move OF table
  2023-08-31 20:14 [PATCH v3 0/2] Match data improvements for wm8580 driver Biju Das
  2023-08-31 20:14 ` [PATCH v3 1/2] ASoC: wm8580: Simplify probe() Biju Das
@ 2023-08-31 20:14 ` Biju Das
  2023-08-31 23:28   ` Andy Shevchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Biju Das @ 2023-08-31 20:14 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Biju Das, Liam Girdwood, Mark Brown, Charles Keepax,
	Andy Shevchenko, Uwe Kleine-König, patches, alsa-devel,
	linux-kernel

Move OF table near to the user.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
 * New patch.
---
 sound/soc/codecs/wm8580.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 826c39ec4a1e..28c0ba348634 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -988,13 +988,6 @@ static const struct wm8580_driver_data wm8581_data = {
 	.num_dacs = 4,
 };
 
-static const struct of_device_id wm8580_of_match[] = {
-	{ .compatible = "wlf,wm8580", .data = &wm8580_data },
-	{ .compatible = "wlf,wm8581", .data = &wm8581_data },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, wm8580_of_match);
-
 static int wm8580_i2c_probe(struct i2c_client *i2c)
 {
 	struct wm8580_priv *wm8580;
@@ -1031,6 +1024,13 @@ static int wm8580_i2c_probe(struct i2c_client *i2c)
 	return ret;
 }
 
+static const struct of_device_id wm8580_of_match[] = {
+	{ .compatible = "wlf,wm8580", .data = &wm8580_data },
+	{ .compatible = "wlf,wm8581", .data = &wm8581_data },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, wm8580_of_match);
+
 static const struct i2c_device_id wm8580_i2c_id[] = {
 	{ "wm8580", (kernel_ulong_t)&wm8580_data },
 	{ "wm8581", (kernel_ulong_t)&wm8581_data },
-- 
2.25.1


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

* Re: [PATCH v3 2/2] ASoC: wm8580: Move OF table
  2023-08-31 20:14 ` [PATCH v3 2/2] ASoC: wm8580: Move OF table Biju Das
@ 2023-08-31 23:28   ` Andy Shevchenko
  2023-09-01  6:33     ` Biju Das
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2023-08-31 23:28 UTC (permalink / raw)
  To: Biju Das
  Cc: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
	Charles Keepax, Uwe Kleine-König, patches, alsa-devel,
	linux-kernel

On Thu, Aug 31, 2023 at 09:14:29PM +0100, Biju Das wrote:
> Move OF table near to the user.

It does a bit more that that.

-- 
With Best Regards,
Andy Shevchenko



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

* RE: [PATCH v3 2/2] ASoC: wm8580: Move OF table
  2023-08-31 23:28   ` Andy Shevchenko
@ 2023-09-01  6:33     ` Biju Das
  2023-09-01  8:50       ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Biju Das @ 2023-09-01  6:33 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
	Charles Keepax, Uwe Kleine-König, patches, alsa-devel,
	linux-kernel

Hi Andy,

> Subject: Re: [PATCH v3 2/2] ASoC: wm8580: Move OF table
> 
> On Thu, Aug 31, 2023 at 09:14:29PM +0100, Biju Das wrote:
> > Move OF table near to the user.
> 
> It does a bit more that that.

OK I will send separate patch for removing trailing comma
in terminator.

Cheers,
Biju

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

* Re: [PATCH v3 2/2] ASoC: wm8580: Move OF table
  2023-09-01  6:33     ` Biju Das
@ 2023-09-01  8:50       ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2023-09-01  8:50 UTC (permalink / raw)
  To: Biju Das
  Cc: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown,
	Charles Keepax, Uwe Kleine-König, patches, alsa-devel,
	linux-kernel

On Fri, Sep 01, 2023 at 06:33:08AM +0000, Biju Das wrote:
> Hi Andy,
> 
> > Subject: Re: [PATCH v3 2/2] ASoC: wm8580: Move OF table
> > 
> > On Thu, Aug 31, 2023 at 09:14:29PM +0100, Biju Das wrote:
> > > Move OF table near to the user.
> > 
> > It does a bit more that that.
> 
> OK I will send separate patch for removing trailing comma
> in terminator.

It's fine to have them in a single patch as they are kinda related
(since you touch the lines anyway). My point is that this change
also needs to be described in the commit message.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2023-09-01  8:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31 20:14 [PATCH v3 0/2] Match data improvements for wm8580 driver Biju Das
2023-08-31 20:14 ` [PATCH v3 1/2] ASoC: wm8580: Simplify probe() Biju Das
2023-08-31 20:14 ` [PATCH v3 2/2] ASoC: wm8580: Move OF table Biju Das
2023-08-31 23:28   ` Andy Shevchenko
2023-09-01  6:33     ` Biju Das
2023-09-01  8:50       ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.