]> git.baikalelectronics.ru Git - 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)
commit316ed10fa3fbac7d831da57a2cb1519f8e64ab59
treea2011f7aae6bbd32371242ac529b245d3b5bf834
parent0eb3878d331eafe6e6d81e8fd6b63a390eed3693
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