diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-07-11 15:48:18 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-07-17 22:25:47 +0200 |
commit | 82887c0beb1ee6b33eed8318d8e8d41c5b3eddae (patch) | |
tree | 884159632784699ff4360d09b32ac51847418edb /sound/soc | |
parent | ae891abe7c2ccf75b69ca8330225e37ecc06924e (diff) | |
download | blackbird-op-linux-82887c0beb1ee6b33eed8318d8e8d41c5b3eddae.tar.gz blackbird-op-linux-82887c0beb1ee6b33eed8318d8e8d41c5b3eddae.zip |
ALSA: hda/i915: Associate audio component with devres
The HD-audio i915 binding code contains a single pointer, hdac_acomp,
for allowing the access to audio component from the master bind/unbind
callbacks. This was needed because the callbacks pass only the device
pointer and we can't guarantee the object type assigned to the drvdata
(which is free for each controller driver implementation).
And this implementation will be a problem if we support multiple
components for different DRM drivers, not only i915.
As a solution, allocate the audio component object via devres and
associate it with the given device, so that the component callbacks
can refer to it via devres_find().
The removal of the object is still done half-manually via
devres_destroy() to make the code consistent (although it may work
without the explicit call).
Also, the snd_hda_i915_register_notifier() had the reference to
hdac_acomp as well. In this patch, the corresponding code is removed
by passing hdac_bus object to the function, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/hdac_hdmi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 460075475f20..2b7c33db4ded 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1812,7 +1812,7 @@ static int hdmi_codec_probe(struct snd_soc_component *component) return ret; aops.audio_ptr = hdev; - ret = snd_hdac_i915_register_notifier(&aops); + ret = snd_hdac_i915_register_notifier(hdev->bus, &aops); if (ret < 0) { dev_err(&hdev->dev, "notifier register failed: err: %d\n", ret); return ret; |