static void ymfpci_download_image(ymfpci_t *codec);
static void ymf_memload(ymfpci_t *unit);
-static spinlock_t ymf_devs_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ymf_devs_lock);
static LIST_HEAD(ymf_devs);
/*
* common I/O routines
*/
-static inline u8 ymfpci_readb(ymfpci_t *codec, u32 offset)
-{
- return readb(codec->reg_area_virt + offset);
-}
-
static inline void ymfpci_writeb(ymfpci_t *codec, u32 offset, u8 val)
{
writeb(val, codec->reg_area_virt + offset);
dmabuf->dma_addr = dma_addr;
dmabuf->buforder = order;
- /* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
+ /* now mark the pages as reserved; otherwise remap_pfn_range doesn't do what we want */
mapend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
for (map = virt_to_page(rawbuf); map <= mapend; map++)
set_bit(PG_reserved, &map->flags);
unsigned int swptr;
int cnt; /* This many to go in this revolution */
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!dmabuf->ready && (ret = prog_dmabuf(state, 1)))
YMFDBGW("ymf_write: count %d\n", count);
- if (ppos != &file->f_pos)
- return -ESPIPE;
if (dmabuf->mapped)
return -ENXIO;
if (!dmabuf->ready && (ret = prog_dmabuf(state, 0)))
size = vma->vm_end - vma->vm_start;
if (size > (PAGE_SIZE << dmabuf->buforder))
return -EINVAL;
- if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf),
+ if (remap_pfn_range(vma, vma->vm_start,
+ virt_to_phys(dmabuf->rawbuf) >> PAGE_SHIFT,
size, vma->vm_page_prot))
return -EAGAIN;
dmabuf->mapped = 1;
#endif
up(&unit->open_sem);
- return 0;
+ return nonseekable_open(inode, file);
out_nodma:
/*
match:
file->private_data = unit->ac97_codec[i];
- return 0;
+ return nonseekable_open(inode, file);
}
static int ymf_ioctl_mixdev(struct inode *inode, struct file *file,
/*
*/
-static int ymf_suspend(struct pci_dev *pcidev, u32 unused)
+static int ymf_suspend(struct pci_dev *pcidev, pm_message_t unused)
{
struct ymf_unit *unit = pci_get_drvdata(pcidev);
unsigned long flags;
codec->dma_area_ba = pba;
codec->dma_area_size = size + 0xff;
- if ((off = ((uint) ptr) & 0xff) != 0) {
+ off = (unsigned long)ptr & 0xff;
+ if (off) {
ptr += 0x100 - off;
pba += 0x100 - off;
}
# ifdef MODULE
static int mpu_io;
static int synth_io;
-MODULE_PARM(mpu_io, "i");
-MODULE_PARM(synth_io, "i");
+module_param(mpu_io, int, 0);
+module_param(synth_io, int, 0);
# else
static int mpu_io = 0x330;
static int synth_io = 0x388;