Commit e61ab9f0 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda: Initialize ext-bus-specific fields in snd_hdac_bus_init(), too

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 99fff44f
...@@ -297,7 +297,7 @@ struct hdac_rb { ...@@ -297,7 +297,7 @@ struct hdac_rb {
* @num_streams: streams supported * @num_streams: streams supported
* @idx: HDA link index * @idx: HDA link index
* @hlink_list: link list of HDA links * @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 * @cmd_dma_state: state of cmd DMAs: CORB and RIRB
*/ */
struct hdac_bus { struct hdac_bus {
...@@ -363,6 +363,7 @@ struct hdac_bus { ...@@ -363,6 +363,7 @@ struct hdac_bus {
/* locks */ /* locks */
spinlock_t reg_lock; spinlock_t reg_lock;
struct mutex cmd_mutex; struct mutex cmd_mutex;
struct mutex lock;
/* DRM component interface */ /* DRM component interface */
struct drm_audio_component *audio_component; struct drm_audio_component *audio_component;
...@@ -373,11 +374,9 @@ struct hdac_bus { ...@@ -373,11 +374,9 @@ struct hdac_bus {
int num_streams; int num_streams;
int idx; int idx;
/* link management */
struct list_head hlink_list; struct list_head hlink_list;
struct mutex lock;
bool cmd_dma_state; bool cmd_dma_state;
}; };
int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
......
...@@ -104,9 +104,7 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, ...@@ -104,9 +104,7 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
return ret; return ret;
bus->ext_ops = ext_ops; bus->ext_ops = ext_ops;
INIT_LIST_HEAD(&bus->hlink_list);
bus->idx = idx++; bus->idx = idx++;
bus->cmd_dma_state = true; bus->cmd_dma_state = true;
return 0; return 0;
......
...@@ -39,6 +39,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, ...@@ -39,6 +39,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
spin_lock_init(&bus->reg_lock); spin_lock_init(&bus->reg_lock);
mutex_init(&bus->cmd_mutex); mutex_init(&bus->cmd_mutex);
mutex_init(&bus->lock); mutex_init(&bus->lock);
INIT_LIST_HEAD(&bus->hlink_list);
bus->irq = -1; bus->irq = -1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment