Skip to content

Commit aa07f95

Browse files
ujfalusibardliao
authored andcommitted
ALSA: hda: convert audio_component member of hdac_bus to void pointer
The hdac_bus->audio_component is used as a pointer to a 'struct drm_audio_component' or to 'struct i915_audio_component' while it's type is 'struct drm_audio_component'. Convert it to void* to avoid this abuse. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 7b8a0b7 commit aa07f95

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/sound/hdaudio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ struct hdac_bus {
366366
struct mutex lock;
367367

368368
/* DRM component interface */
369-
struct drm_audio_component *audio_component;
369+
void *audio_component;
370370
long display_power_status;
371371
unsigned long display_power_active;
372372

sound/hda/hdac_component.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,12 @@ static const struct component_master_ops hdac_component_master_ops = {
252252
int snd_hdac_acomp_register_notifier(struct hdac_bus *bus,
253253
const struct drm_audio_component_audio_ops *aops)
254254
{
255-
if (!bus->audio_component)
255+
struct drm_audio_component *acomp = bus->audio_component;
256+
257+
if (!acomp)
256258
return -ENODEV;
257259

258-
bus->audio_component->audio_ops = aops;
260+
acomp->audio_ops = aops;
259261
return 0;
260262
}
261263
EXPORT_SYMBOL_GPL(snd_hdac_acomp_register_notifier);

0 commit comments

Comments
 (0)