X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Documentation%2Fsound%2Falsa%2FDocBook%2Fwriting-an-alsa-driver.tmpl;h=fae0c98cfdca28e411a8190aaa9eabceda31aefd;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=934a49a595fbea66f3f4e51ee7e8316140e29038;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index 934a49a59..fae0c98cf 100644 --- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl @@ -3641,7 +3641,7 @@ struct _snd_pcm_runtime { More precise information can be found in - alsa-kernel/Documentation/sound/alsa/ControlNames.txt. + Documentation/sound/alsa/ControlNames.txt. @@ -5182,7 +5182,7 @@ struct _snd_pcm_runtime { The callback is much more complicated than the text-file version. You need to use a low-level i/o functions such as copy_from/to_user() to transfer the - data. Also, you have to keep tracking the file position, too. + data. @@ -5190,14 +5190,15 @@ struct _snd_pcm_runtime { static long my_file_io_read(snd_info_entry_t *entry, void *file_private_data, struct file *file, - char *buf, long count) + char *buf, + unsigned long count, + unsigned long pos) { long size = count; - if (file->f_pos + size > local_max_size) - size = local_max_size - file->f_pos; - if (copy_to_user(buf, local_data + file->f_pos, size)) + if (pos + size > local_max_size) + size = local_max_size - pos; + if (copy_to_user(buf, local_data + pos, size)) return -EFAULT; - file->f_pos += size; return size; } ]]>