X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fmixart%2Fmixart.c;h=7e312df0c5bfe7d3215a5eea5741092935bc31dd;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=2b918cc7f529bb75c2339b8dbcc44609dc4549f4;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 2b918cc7f..7e312df0c 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -1154,18 +1154,18 @@ static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry, mixart_BA0 proc interface for BAR 0 - read callback */ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data, - struct file *file, char __user *buf, long count) + struct file *file, char __user *buf, + unsigned long count, unsigned long pos) { mixart_mgr_t *mgr = snd_magic_cast(mixart_mgr_t, entry->private_data, return -ENXIO); count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ if(count <= 0) return 0; - if(file->f_pos + count > MIXART_BA0_SIZE) - count = (long)(MIXART_BA0_SIZE - file->f_pos); - if(copy_to_user_fromio(buf, MIXART_MEM( mgr, file->f_pos ), count)) + if(pos + count > MIXART_BA0_SIZE) + count = (long)(MIXART_BA0_SIZE - pos); + if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count)) return -EFAULT; - file->f_pos += count; return count; } @@ -1173,18 +1173,18 @@ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data mixart_BA1 proc interface for BAR 1 - read callback */ static long snd_mixart_BA1_read(snd_info_entry_t *entry, void *file_private_data, - struct file *file, char __user *buf, long count) + struct file *file, char __user *buf, + unsigned long count, unsigned long pos) { mixart_mgr_t *mgr = snd_magic_cast(mixart_mgr_t, entry->private_data, return -ENXIO); count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ if(count <= 0) return 0; - if(file->f_pos + count > MIXART_BA1_SIZE) - count = (long)(MIXART_BA1_SIZE - file->f_pos); - if(copy_to_user_fromio(buf, MIXART_REG( mgr, file->f_pos ), count)) + if(pos + count > MIXART_BA1_SIZE) + count = (long)(MIXART_BA1_SIZE - pos); + if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count)) return -EFAULT; - file->f_pos += count; return count; }