alistair23-linux/include
Kuninori Morimoto b7c5bc45ee
ASoC: soc-core: merge soc_free_pcm_runtime() and soc_rtd_free()
"rtd"      is handled by soc_xxx_pcm_runtime(), and
"rtd->dev" is handled by soc_rtd_xxx().

There is no reason to separate these, and it makes code complex.
We can free these in the same time.

Here soc_rtd_free() (A) which frees rtd->dev is called from
soc_remove_link_dais() many times (1).
Then, it is using dev_registered flags to avoid multi kfree() (2).
This is no longer needed if we can merge these functions.

	static void soc_remove_link_dais(...)
	{
		...
(1)		for_each_comp_order(order) {
(1)			for_each_card_rtds(card, rtd) {

(A)				soc_rtd_free(rtd);
				...
			}
		}
	}

(A)	static void soc_rtd_free(...)
	{
(2)		if (rtd->dev_registered) {
			/* we don't need to call kfree() for rtd->dev */
			device_unregister(rtd->dev);
(2)			rtd->dev_registered = 0;
		}
	}

This patch merges soc_rtd_free() into soc_free_pcm_runtime().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878squf7oi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01 12:12:53 +01:00
..
acpi ACPI updates for 5.4-rc1 2019-09-17 19:31:36 -07:00
asm-generic Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-09-28 08:14:15 -07:00
clocksource
crypto Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity 2019-09-27 19:37:27 -07:00
drm drm: Measure Self Refresh Entry/Exit times to avoid thrashing 2019-09-19 10:03:32 -04:00
dt-bindings Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
keys
kvm
linux libnvdimm fixes v5.4-rc1 2019-09-29 10:33:41 -07:00
math-emu nds32: Mark expected switch fall-throughs 2019-08-29 11:06:56 -05:00
media
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2019-09-27 20:15:00 +02:00
pcmcia
ras
rdma RDMA subsystem updates for 5.4 2019-09-21 10:26:24 -07:00
scsi SCSI misc on 20190919 2019-09-21 10:50:15 -07:00
soc Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
sound ASoC: soc-core: merge soc_free_pcm_runtime() and soc_rtd_free() 2019-10-01 12:12:53 +01:00
target
trace A few more tracing fixes: 2019-09-30 09:29:53 -07:00
uapi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-09-28 17:47:33 -07:00
vdso
video
xen swiotlb-xen: simplify cache maintainance 2019-09-11 12:43:27 +02:00
Kbuild - New Drivers 2019-09-23 19:37:49 -07:00