Ignore:
Timestamp:
Jul 5, 2010, 11:51:20 AM (15 years ago)
Author:
Paul Smedley
Message:

Update Uniaud32-2.1.x branch with necessary changes for ALSA 1.0.23

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.1.x/alsa-kernel/pci/cs4281.c

    r464 r499  
    495495static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id);
    496496
    497 static struct pci_device_id snd_cs4281_ids[] = {
     497static DEFINE_PCI_DEVICE_TABLE(snd_cs4281_ids) = {
    498498        { PCI_VDEVICE(CIRRUS, 0x6005), 0, },    /* CS4281 */
    499499        { 0, }
     
    11401140}
    11411141
    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;
     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{
    11481147        struct cs4281 *chip = entry->private_data;
    11491148       
    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
     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{
    11661159        struct cs4281 *chip = entry->private_data;
    11671160       
    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;
    11761164}
    11771165
Note: See TracChangeset for help on using the changeset viewer.