cs4281.c (24e4a1211f691fc671de44685430dbad757d8487) | cs4281.c (d97e1b78239c7e7e441088e0b644bd3b076002e6) |
---|---|
1/* 2 * Driver for Cirrus Logic CS4281 based PCI soundcard 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 4 * 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 1130 unchanged lines hidden (view full) --- 1139 snd_iprintf(buffer, "Spurious end IRQs : %u\n", chip->spurious_dtc_irq); 1140} 1141 1142static ssize_t snd_cs4281_BA0_read(struct snd_info_entry *entry, 1143 void *file_private_data, 1144 struct file *file, char __user *buf, 1145 size_t count, loff_t pos) 1146{ | 1/* 2 * Driver for Cirrus Logic CS4281 based PCI soundcard 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 4 * 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 1130 unchanged lines hidden (view full) --- 1139 snd_iprintf(buffer, "Spurious end IRQs : %u\n", chip->spurious_dtc_irq); 1140} 1141 1142static ssize_t snd_cs4281_BA0_read(struct snd_info_entry *entry, 1143 void *file_private_data, 1144 struct file *file, char __user *buf, 1145 size_t count, loff_t pos) 1146{ |
1147 long size; | |
1148 struct cs4281 *chip = entry->private_data; 1149 | 1147 struct cs4281 *chip = entry->private_data; 1148 |
1150 size = count; 1151 if (pos + size > CS4281_BA0_SIZE) 1152 size = (long)CS4281_BA0_SIZE - pos; 1153 if (size > 0) { 1154 if (copy_to_user_fromio(buf, chip->ba0 + pos, size)) 1155 return -EFAULT; 1156 } 1157 return size; | 1149 if (copy_to_user_fromio(buf, chip->ba0 + pos, count)) 1150 return -EFAULT; 1151 return count; |
1158} 1159 1160static ssize_t snd_cs4281_BA1_read(struct snd_info_entry *entry, 1161 void *file_private_data, 1162 struct file *file, char __user *buf, 1163 size_t count, loff_t pos) 1164{ | 1152} 1153 1154static ssize_t snd_cs4281_BA1_read(struct snd_info_entry *entry, 1155 void *file_private_data, 1156 struct file *file, char __user *buf, 1157 size_t count, loff_t pos) 1158{ |
1165 long size; | |
1166 struct cs4281 *chip = entry->private_data; 1167 | 1159 struct cs4281 *chip = entry->private_data; 1160 |
1168 size = count; 1169 if (pos + size > CS4281_BA1_SIZE) 1170 size = (long)CS4281_BA1_SIZE - pos; 1171 if (size > 0) { 1172 if (copy_to_user_fromio(buf, chip->ba1 + pos, size)) 1173 return -EFAULT; 1174 } 1175 return size; | 1161 if (copy_to_user_fromio(buf, chip->ba1 + pos, count)) 1162 return -EFAULT; 1163 return count; |
1176} 1177 1178static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { 1179 .read = snd_cs4281_BA0_read, 1180}; 1181 1182static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { 1183 .read = snd_cs4281_BA1_read, --- 938 unchanged lines hidden --- | 1164} 1165 1166static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { 1167 .read = snd_cs4281_BA0_read, 1168}; 1169 1170static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { 1171 .read = snd_cs4281_BA1_read, --- 938 unchanged lines hidden --- |