All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Sridharan@sirena.org.uk, Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>,
	Ranjani <ranjani.sridharan@intel.com>
Subject: Applied "ASoC: soc-core: use device_register()" to the asoc tree
Date: Thu, 22 Aug 2019 19:32:57 +0100 (BST)	[thread overview]
Message-ID: <20190822183257.14831D02CD4@fitzroy.sirena.org.uk> (raw)
In-Reply-To: <878sro1ldw.wl-kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: soc-core: use device_register()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 4168ddabb480bef818c93f378428632fb681b500 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Tue, 20 Aug 2019 14:04:49 +0900
Subject: [PATCH] ASoC: soc-core: use device_register()

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.

soc-core.c is using device_unregiser(), but there is no its paired
device_regiser(). We can find its code at soc_post_component_init()
which is using device_initialize() and device_add().
Here, device_initialize() + device_add() = device_register().

	-- linux/drivers/base/core.c --
	int device_register(struct device *dev)
	{
		device_initialize(dev);
		return device_add(dev);
	}

device_initialize() is doing each dev member's initialization only,
not related to device parent/release/groups.
Thus, we can postpone it.
let's use device_register() instead of device_initialize()/device_add().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/878sro1ldw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6df880be1622..3860d8521734 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1347,7 +1347,6 @@ static int soc_post_component_init(struct snd_soc_pcm_runtime *rtd,
 	rtd->dev = kzalloc(sizeof(struct device), GFP_KERNEL);
 	if (!rtd->dev)
 		return -ENOMEM;
-	device_initialize(rtd->dev);
 	rtd->dev->parent = rtd->card->dev;
 	rtd->dev->release = rtd_release;
 	rtd->dev->groups = soc_dev_attr_groups;
@@ -1357,7 +1356,7 @@ static int soc_post_component_init(struct snd_soc_pcm_runtime *rtd,
 	INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].be_clients);
 	INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_PLAYBACK].fe_clients);
 	INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].fe_clients);
-	ret = device_add(rtd->dev);
+	ret = device_register(rtd->dev);
 	if (ret < 0) {
 		/* calling put_device() here to free the rtd->dev */
 		put_device(rtd->dev);
-- 
2.20.1

  reply	other threads:[~2019-08-22 18:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  5:04 [PATCH resend 00/11] ASoC: soc-core cleanup repost Kuninori Morimoto
2019-08-20  5:04 ` [PATCH resend 01/11] ASoC: soc-core: use device_register() Kuninori Morimoto
2019-08-22 18:32   ` Mark Brown [this message]
2019-08-20  5:04 ` [PATCH resend 02/11] ASoC: soc-core: merge snd_soc_initialize_card_lists() Kuninori Morimoto
2019-08-21 12:15   ` Applied "ASoC: soc-core: merge snd_soc_initialize_card_lists()" to the asoc tree Mark Brown
2019-08-20  5:04 ` [PATCH resend 03/11] ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link() Kuninori Morimoto
2019-08-21 12:15   ` Applied "ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link()" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 04/11] ASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup() Kuninori Morimoto
2019-08-22 18:32   ` Applied "ASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup()" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 05/11] ASoC: soc-core: don't alloc memory carelessly when creating debugfs Kuninori Morimoto
2019-08-22 17:18   ` Mark Brown
2019-08-20  5:05 ` [PATCH resend 06/11] ASoC: soc-core: soc_cleanup_card_resources() become void Kuninori Morimoto
2019-08-22 18:32   ` Applied "ASoC: soc-core: soc_cleanup_card_resources() become void" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 07/11] ASoC: soc-core: initialize component list Kuninori Morimoto
2019-08-22 18:32   ` Applied "ASoC: soc-core: initialize component list" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 08/11] ASoC: soc-core: initialize list at one place Kuninori Morimoto
2019-08-22 18:32   ` Applied "ASoC: soc-core: initialize list at one place" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 08/11] ASoC: soc-core: initialize list at one place Kuninori Morimoto
2019-08-20  5:05 ` [PATCH resend 09/11] ASoC: soc-dai: use bit field for bus_control Kuninori Morimoto
2019-08-22 18:32   ` Applied "ASoC: soc-dai: use bit field for bus_control" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 10/11] ASoC: soc-topology: use for_each_component_dais() at remove_dai() Kuninori Morimoto
2019-08-22 18:32   ` Applied "ASoC: soc-topology: use for_each_component_dais() at remove_dai()" to the asoc tree Mark Brown
2019-08-20  5:05 ` [PATCH resend 10/11] ASoC: soc-topology: use for_each_component_dais() at remove_dai() Kuninori Morimoto
2019-08-20  5:05 ` [PATCH resend 11/11] ASoC: soc-core: add soc_unbind_aux_dev() Kuninori Morimoto

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=20190822183257.14831D02CD4@fitzroy.sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=Sridharan@sirena.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=ranjani.sridharan@intel.com \
    /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 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.