diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-01-30 20:09:01 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-02-03 19:24:24 +0300 |
commit | bf8b24f8169096050795b552a778faaac349c73c (patch) | |
tree | 07179ca69776ad1ba18643b57cea4a3c294b6fc6 /sound/x86/intel_hdmi_audio.c | |
parent | af3e5c9c5d370e262da97fb8a8310a9d578efa0d (diff) | |
download | linux-bf8b24f8169096050795b552a778faaac349c73c.tar.xz |
ALSA: x86: Drop the global platform device reference
Instead of referring to the global hlpe_pdev variable, pass the
platform device object to each function properly. Accessing to the
global object is really ugly and error-prone.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86/intel_hdmi_audio.c')
-rw-r--r-- | sound/x86/intel_hdmi_audio.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 571ec07a3611..ed9db2ebe9cf 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -172,11 +172,12 @@ int had_get_hwstate(struct snd_intelhad *intelhaddata) int had_get_caps(struct snd_intelhad *intelhaddata, enum had_caps_list query, void *caps) { + struct platform_device *pdev = to_platform_device(intelhaddata->dev); int retval; retval = had_get_hwstate(intelhaddata); if (!retval) - retval = mid_hdmi_audio_get_caps(query, caps); + retval = mid_hdmi_audio_get_caps(pdev, query, caps); return retval; } @@ -184,33 +185,36 @@ int had_get_caps(struct snd_intelhad *intelhaddata, int had_set_caps(struct snd_intelhad *intelhaddata, enum had_caps_list set_element, void *caps) { + struct platform_device *pdev = to_platform_device(intelhaddata->dev); int retval; retval = had_get_hwstate(intelhaddata); if (!retval) - retval = mid_hdmi_audio_set_caps(set_element, caps); + retval = mid_hdmi_audio_set_caps(pdev, set_element, caps); return retval; } int had_read_register(struct snd_intelhad *intelhaddata, u32 offset, u32 *data) { + struct platform_device *pdev = to_platform_device(intelhaddata->dev); int retval; retval = had_get_hwstate(intelhaddata); if (!retval) - retval = mid_hdmi_audio_read(offset, data); + retval = mid_hdmi_audio_read(pdev, offset, data); return retval; } int had_write_register(struct snd_intelhad *intelhaddata, u32 offset, u32 data) { + struct platform_device *pdev = to_platform_device(intelhaddata->dev); int retval; retval = had_get_hwstate(intelhaddata); if (!retval) - retval = mid_hdmi_audio_write(offset, data); + retval = mid_hdmi_audio_write(pdev, offset, data); return retval; } @@ -218,11 +222,12 @@ int had_write_register(struct snd_intelhad *intelhaddata, u32 offset, u32 data) int had_read_modify(struct snd_intelhad *intelhaddata, u32 offset, u32 data, u32 mask) { + struct platform_device *pdev = to_platform_device(intelhaddata->dev); int retval; retval = had_get_hwstate(intelhaddata); if (!retval) - retval = mid_hdmi_audio_rmw(offset, data, mask); + retval = mid_hdmi_audio_rmw(pdev, offset, data, mask); return retval; } |