]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-core: use device_register()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 20 Aug 2019 05:04:49 +0000 (14:04 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 22 Aug 2019 17:29:26 +0000 (18:29 +0100)
commit5fd8273f1a8023702b1e37ad6ada9c09cf630c9c
treef4bd55b286b476206babd0f04c9d54c3074315c1
parentb517aaef9485808f08818282ad27d37dec1af18e
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