From e15b0b6a1b95e4145363b15e1a581ee230b2f9a2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 23 Apr 2003 23:42:29 +0000 Subject: Install dummy/noop read & poll fops unless the driver has replacements. --- linux-core/drmP.h | 2 ++ linux-core/drm_drv.c | 8 ++++++++ linux-core/drm_fops.c | 13 +++++++++++++ 3 files changed, 23 insertions(+) (limited to 'linux-core') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 2cdc5f09..8ebd1ec8 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -684,6 +684,8 @@ extern void DRM(vm_shm_close)(struct vm_area_struct *vma); extern int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma); extern int DRM(mmap)(struct file *filp, struct vm_area_struct *vma); +extern unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait); +extern ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off); /* Memory management support (drm_memory.h) */ extern void DRM(mem_init)(void); diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 036cee35..dad961f8 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -84,6 +84,12 @@ #ifndef __HAVE_SG #define __HAVE_SG 0 #endif +#ifndef __HAVE_DRIVER_FOPS_READ +#define __HAVE_DRIVER_FOPS_READ 0 +#endif +#ifndef __HAVE_DRIVER_FOPS_POLL +#define __HAVE_DRIVER_FOPS_POLL 0 +#endif #ifndef DRIVER_PREINIT #define DRIVER_PREINIT() @@ -119,6 +125,8 @@ static struct file_operations DRM(fops) = { \ .ioctl = DRM(ioctl), \ .mmap = DRM(mmap), \ .fasync = DRM(fasync), \ + .poll = DRM(poll), \ + .read = DRM(read), \ } #endif diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index 3baac693..fc8618e1 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -113,4 +113,17 @@ int DRM(fasync)(int fd, struct file *filp, int on) return 0; } +#if !__HAVE_DRIVER_FOPS_POLL +unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait) +{ + return 0; +} +#endif + +#if !__HAVE_DRIVER_FOPS_READ +ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off) +{ + return 0; +} +#endif -- cgit v1.2.3