]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ALSA: hda: Initialize ext-bus-specific fields in snd_hdac_bus_init(), too
authorTakashi Iwai <tiwai@suse.de>
Wed, 10 Apr 2019 14:00:54 +0000 (16:00 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sat, 13 Apr 2019 08:10:26 +0000 (10:10 +0200)
Some fields in snd_hdac_bus are ext-bus specific, but they still
should be initialized in snd_hdac_bus_init() for consistency, at
least, for the ones that do need the explicit initialization like the
list head.

Also move the lock field to the more appropriate place and correct the
comment to reflect the recent change where it serves for both the
display power and the link management.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hdaudio.h
sound/hda/ext/hdac_ext_bus.c
sound/hda/hdac_bus.c

index 45f944d57982800cc176ed782aedbf9b1d30f1fe..ca1d9a70d0261b7f0ee217f6927ae161a0dad993 100644 (file)
@@ -297,7 +297,7 @@ struct hdac_rb {
  * @num_streams: streams supported
  * @idx: HDA link index
  * @hlink_list: link list of HDA links
- * @lock: lock for link mgmt
+ * @lock: lock for link and display power mgmt
  * @cmd_dma_state: state of cmd DMAs: CORB and RIRB
  */
 struct hdac_bus {
@@ -363,6 +363,7 @@ struct hdac_bus {
        /* locks */
        spinlock_t reg_lock;
        struct mutex cmd_mutex;
+       struct mutex lock;
 
        /* DRM component interface */
        struct drm_audio_component *audio_component;
@@ -373,11 +374,9 @@ struct hdac_bus {
        int num_streams;
        int idx;
 
+       /* link management */
        struct list_head hlink_list;
-
-       struct mutex lock;
        bool cmd_dma_state;
-
 };
 
 int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
index ec7715c6b0c02c9bc940ed4b16f387b509bd1907..c203af71a0995f76842367d25b299bc6eecef279 100644 (file)
@@ -104,9 +104,7 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
                return ret;
 
        bus->ext_ops = ext_ops;
-       INIT_LIST_HEAD(&bus->hlink_list);
        bus->idx = idx++;
-
        bus->cmd_dma_state = true;
 
        return 0;
index ad8eee08013fb838e228daaa23cd974a92c34325..10e5d261fde1f962a0a0876ed535a6fc5c0f57d3 100644 (file)
@@ -39,6 +39,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
        spin_lock_init(&bus->reg_lock);
        mutex_init(&bus->cmd_mutex);
        mutex_init(&bus->lock);
+       INIT_LIST_HEAD(&bus->hlink_list);
        bus->irq = -1;
        return 0;
 }