Skip to content
  • Lukas Wunner's avatar
    21b45676
    vga_switcheroo: Set active attribute to false for audio clients · 21b45676
    Lukas Wunner authored
    
    
    The active attribute in struct vga_switcheroo_client denotes whether
    the outputs are currently switched to this client. The attribute is
    only meaningful for vga clients. It is never used for audio clients.
    
    The function vga_switcheroo_register_audio_client() misuses this
    attribute to store whether the audio device is fully initialized.
    Most likely there was a misunderstanding about the meaning of
    "active" when this was added.
    
    Comment from Takashi's review:
    
    "Not really.  The full initialization of audio was meant that the audio
    is active indeed.  Admittedly, though, the active flag for each audio
    client doesn't play any role because the audio always follows the gfx
    state changes, and the value passed there doesn't reflect the actual
    state due to the later change.  So, I agree with the removal of the
    flag itself -- or let the audio active flag following the
    corresponding gfx flag.  The latter will make the proc output more
    consistent while the former is certainly more reduction of code."
    
    Set the active attribute to false for audio clients. Remove the
    active parameter from vga_switcheroo_register_audio_client() and
    its sole caller, hda_intel.c:register_vga_switcheroo().
    
    vga_switcheroo_register_audio_client() was introduced by 3e9e63db
    ("vga_switcheroo: Add the support for audio clients"). Its use in
    hda_intel.c was introduced by a82d51ed ("ALSA: hda - Support
    VGA-switcheroo").
    
    v1.1: The changes above imply that in find_active_client() the call
    to client_is_vga() is now superfluous. Drop it.
    
    Cc: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
    [danvet: Add Takashi's clarification to the commit message.]
    Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    21b45676
    vga_switcheroo: Set active attribute to false for audio clients
    Lukas Wunner authored
    
    
    The active attribute in struct vga_switcheroo_client denotes whether
    the outputs are currently switched to this client. The attribute is
    only meaningful for vga clients. It is never used for audio clients.
    
    The function vga_switcheroo_register_audio_client() misuses this
    attribute to store whether the audio device is fully initialized.
    Most likely there was a misunderstanding about the meaning of
    "active" when this was added.
    
    Comment from Takashi's review:
    
    "Not really.  The full initialization of audio was meant that the audio
    is active indeed.  Admittedly, though, the active flag for each audio
    client doesn't play any role because the audio always follows the gfx
    state changes, and the value passed there doesn't reflect the actual
    state due to the later change.  So, I agree with the removal of the
    flag itself -- or let the audio active flag following the
    corresponding gfx flag.  The latter will make the proc output more
    consistent while the former is certainly more reduction of code."
    
    Set the active attribute to false for audio clients. Remove the
    active parameter from vga_switcheroo_register_audio_client() and
    its sole caller, hda_intel.c:register_vga_switcheroo().
    
    vga_switcheroo_register_audio_client() was introduced by 3e9e63db
    ("vga_switcheroo: Add the support for audio clients"). Its use in
    hda_intel.c was introduced by a82d51ed ("ALSA: hda - Support
    VGA-switcheroo").
    
    v1.1: The changes above imply that in find_active_client() the call
    to client_is_vga() is now superfluous. Drop it.
    
    Cc: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
    [danvet: Add Takashi's clarification to the commit message.]
    Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Loading