]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda: Simplify snd_hdac_refresh_widgets()
authorTakashi Iwai <tiwai@suse.de>
Wed, 3 Jul 2019 12:35:12 +0000 (14:35 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 Jul 2019 10:01:06 +0000 (12:01 +0200)
commit7296944f9f4b6bc052b16e29b2ac90cbcdbe7d15
treef1d8252e2adc8f0f6ca3bb142f5b612699f8cc7e
parent8855bd591debb5cf688a17a938a31808a6376ba2
ALSA: hda: Simplify snd_hdac_refresh_widgets()

Along with the recent fix for the races of snd_hdac_refresh_widgets()
it turned out that the instantiation of widgets sysfs at
snd_hdac_sysfs_reinit() could cause a race.  The race itself was
already covered later by extending the mutex protection range, the
commit 555dd9c418b6 ("ALSA: hda: Fix widget_mutex incomplete
protection"), but this also indicated that the call of *_reinit() is
basically superfluous, as the widgets shall be created sooner or later
from snd_hdac_device_register().

This patch removes the redundant call of snd_hdac_sysfs_reinit() at
first.  By this removal, the sysfs argument itself in
snd_hdac_refresh_widgets() becomes superfluous, too, because the only
case sysfs=false is always with codec->widgets=NULL.  So, we drop this
redundant argument as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hdaudio.h
sound/hda/hdac_device.c
sound/hda/hdac_sysfs.c
sound/pci/hda/hda_codec.c
sound/soc/codecs/hdac_hdmi.c