Loading Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +1 −18 Original line number Diff line number Diff line Loading @@ -5333,7 +5333,7 @@ struct _snd_pcm_runtime { <informalexample> <programlisting> <![CDATA[ snd_info_set_text_ops(entry, chip, read_size, my_proc_read); snd_info_set_text_ops(entry, chip, my_proc_read); ]]> </programlisting> </informalexample> Loading Loading @@ -5394,29 +5394,12 @@ struct _snd_pcm_runtime { <informalexample> <programlisting> <![CDATA[ entry->c.text.write_size = 256; entry->c.text.write = my_proc_write; ]]> </programlisting> </informalexample> </para> <para> The buffer size for read is set to 1024 implicitly by <function>snd_info_set_text_ops()</function>. It should suffice in most cases (the size will be aligned to <constant>PAGE_SIZE</constant> anyway), but if you need to handle very large text files, you can set it explicitly, too. <informalexample> <programlisting> <![CDATA[ entry->c.text.read_size = 65536; ]]> </programlisting> </informalexample> </para> <para> For the write callback, you can use <function>snd_info_get_line()</function> to get a text line, and Loading include/sound/info.h +0 −5 Original line number Diff line number Diff line Loading @@ -40,8 +40,6 @@ struct snd_info_buffer { struct snd_info_entry; struct snd_info_entry_text { unsigned long read_size; unsigned long write_size; void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); }; Loading Loading @@ -132,11 +130,9 @@ int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_e static inline void snd_info_set_text_ops(struct snd_info_entry *entry, void *private_data, long read_size, void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) { entry->private_data = private_data; entry->c.text.read_size = read_size; entry->c.text.read = read; } Loading Loading @@ -167,7 +163,6 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_entry **entryp) { return -EINVAL; } static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), void *private_data, long read_size, void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} static inline int snd_info_check_reserved_words(const char *str) { return 1; } Loading sound/core/hwdep.c +0 −1 Original line number Diff line number Diff line Loading @@ -486,7 +486,6 @@ static void __init snd_hwdep_proc_init(void) struct snd_info_entry *entry; if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) { entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_hwdep_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading sound/core/info_oss.c +0 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,6 @@ int snd_info_minor_register(void) memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings)); if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) { entry->c.text.read_size = 2048; entry->c.text.read = snd_sndstat_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading sound/core/init.c +0 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ static inline int init_info_for_card(struct snd_card *card) snd_printd("unable to create card entry\n"); return err; } entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_card_id_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading Loading @@ -592,7 +591,6 @@ int __init snd_card_info_init(void) entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL); if (! entry) return -ENOMEM; entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_card_info_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading @@ -603,7 +601,6 @@ int __init snd_card_info_init(void) #ifdef MODULE entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL); if (entry) { entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_card_module_info_read; if (snd_info_register(entry) < 0) snd_info_free_entry(entry); Loading Loading
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +1 −18 Original line number Diff line number Diff line Loading @@ -5333,7 +5333,7 @@ struct _snd_pcm_runtime { <informalexample> <programlisting> <![CDATA[ snd_info_set_text_ops(entry, chip, read_size, my_proc_read); snd_info_set_text_ops(entry, chip, my_proc_read); ]]> </programlisting> </informalexample> Loading Loading @@ -5394,29 +5394,12 @@ struct _snd_pcm_runtime { <informalexample> <programlisting> <![CDATA[ entry->c.text.write_size = 256; entry->c.text.write = my_proc_write; ]]> </programlisting> </informalexample> </para> <para> The buffer size for read is set to 1024 implicitly by <function>snd_info_set_text_ops()</function>. It should suffice in most cases (the size will be aligned to <constant>PAGE_SIZE</constant> anyway), but if you need to handle very large text files, you can set it explicitly, too. <informalexample> <programlisting> <![CDATA[ entry->c.text.read_size = 65536; ]]> </programlisting> </informalexample> </para> <para> For the write callback, you can use <function>snd_info_get_line()</function> to get a text line, and Loading
include/sound/info.h +0 −5 Original line number Diff line number Diff line Loading @@ -40,8 +40,6 @@ struct snd_info_buffer { struct snd_info_entry; struct snd_info_entry_text { unsigned long read_size; unsigned long write_size; void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); }; Loading Loading @@ -132,11 +130,9 @@ int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_e static inline void snd_info_set_text_ops(struct snd_info_entry *entry, void *private_data, long read_size, void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) { entry->private_data = private_data; entry->c.text.read_size = read_size; entry->c.text.read = read; } Loading Loading @@ -167,7 +163,6 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_entry **entryp) { return -EINVAL; } static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), void *private_data, long read_size, void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} static inline int snd_info_check_reserved_words(const char *str) { return 1; } Loading
sound/core/hwdep.c +0 −1 Original line number Diff line number Diff line Loading @@ -486,7 +486,6 @@ static void __init snd_hwdep_proc_init(void) struct snd_info_entry *entry; if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) { entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_hwdep_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading
sound/core/info_oss.c +0 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,6 @@ int snd_info_minor_register(void) memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings)); if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) { entry->c.text.read_size = 2048; entry->c.text.read = snd_sndstat_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading
sound/core/init.c +0 −3 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ static inline int init_info_for_card(struct snd_card *card) snd_printd("unable to create card entry\n"); return err; } entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_card_id_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading Loading @@ -592,7 +591,6 @@ int __init snd_card_info_init(void) entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL); if (! entry) return -ENOMEM; entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_card_info_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); Loading @@ -603,7 +601,6 @@ int __init snd_card_info_init(void) #ifdef MODULE entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL); if (entry) { entry->c.text.read_size = PAGE_SIZE; entry->c.text.read = snd_card_module_info_read; if (snd_info_register(entry) < 0) snd_info_free_entry(entry); Loading