Changeset 499 for GPL/branches/uniaud32-2.1.x/alsa-kernel/pci/cs4281.c
- Timestamp:
- Jul 5, 2010, 11:51:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.1.x/alsa-kernel/pci/cs4281.c
r464 r499 495 495 static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id); 496 496 497 static struct pci_device_id snd_cs4281_ids[]= {497 static DEFINE_PCI_DEVICE_TABLE(snd_cs4281_ids) = { 498 498 { PCI_VDEVICE(CIRRUS, 0x6005), 0, }, /* CS4281 */ 499 499 { 0, } … … 1140 1140 } 1141 1141 1142 static long snd_cs4281_BA0_read(struct snd_info_entry *entry, 1143 void *file_private_data, 1144 struct file *file, char __user *buf, 1145 unsigned long count, unsigned long pos) 1146 { 1147 long size; 1142 static 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 { 1148 1147 struct cs4281 *chip = entry->private_data; 1149 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; 1158 } 1159 1160 static long snd_cs4281_BA1_read(struct snd_info_entry *entry, 1161 void *file_private_data, 1162 struct file *file, char __user *buf, 1163 unsigned long count, unsigned long pos) 1164 { 1165 long size; 1149 if (copy_to_user_fromio(buf, chip->ba0 + pos, count)) 1150 return -EFAULT; 1151 return count; 1152 } 1153 1154 static 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 { 1166 1159 struct cs4281 *chip = entry->private_data; 1167 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 1164 } 1177 1165
Note:
See TracChangeset
for help on using the changeset viewer.