diff mbox

ASoC: Use dev_set_name() instead of init_name

Message ID 1408267715-19237-1-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Commit f294afed03b154fbfaa9a32a0ebe7abdbf98070c
Headers show

Commit Message

Lars-Peter Clausen Aug. 17, 2014, 9:28 a.m. UTC
init_name is basically a hack and should only be used for statically allocated
device structs. For dynamically allocated devices dev_set_name() should be used.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Aug. 17, 2014, 1:53 p.m. UTC | #1
On Sun, Aug 17, 2014 at 11:28:35AM +0200, Lars-Peter Clausen wrote:
> init_name is basically a hack and should only be used for statically allocated
> device structs. For dynamically allocated devices dev_set_name() should be used.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index d4bfd4a..889f4e3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1325,7 +1325,7 @@  static int soc_post_component_init(struct snd_soc_pcm_runtime *rtd,
 	device_initialize(rtd->dev);
 	rtd->dev->parent = rtd->card->dev;
 	rtd->dev->release = rtd_release;
-	rtd->dev->init_name = name;
+	dev_set_name(rtd->dev, "%s", name);
 	dev_set_drvdata(rtd->dev, rtd);
 	mutex_init(&rtd->pcm_mutex);
 	INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_PLAYBACK].be_clients);