• Takashi Iwai's avatar
    ALSA: core: Use seq_file for text proc file reads · 4adb7bcb
    Takashi Iwai authored
    seq_file is _the_ standard interface for simple text proc files.
    Though, we still need to support the binary proc files and the text
    file write, and also we need to manage the device disconnection
    gracefully.  Thus this patch just replaces the text file read code
    with seq_file while keeping the rest intact.
    
    snd_iprintf() helper function is now a macro to expand itself to
    seq_printf() to be compatible with the existing code.  The seq_file
    object is stored to the unused entry->rbuffer->buffer pointer.
    
    When the output size is expected to be large (greater than PAGE_SIZE),
    the driver should set entry->size field beforehand.  Then the given
    size will be preallocated and the multiple show calls can be avoided.
    Acked-by: default avatarJaroslav Kysela <perex@perex.cz>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    4adb7bcb
info.h 7.34 KB