]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
ALSA: core: Use seq_file for text proc file reads
authorTakashi Iwai <tiwai@suse.de>
Wed, 22 Apr 2015 14:10:22 +0000 (16:10 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 23 Apr 2015 15:11:02 +0000 (17:11 +0200)
commit4adb7bcbcb69d3bee0ed72de83adaee27daccdd8
treea2011f7aae6bbd32371242ac529b245d3b5bf834
parent412b979ccceff448dccea54bdb616c85781bc0ba
ALSA: core: Use seq_file for text proc file reads

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: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/info.h
sound/core/info.c