Handle drivers that don't have __HAVE_SG defined.
authorAlan Hourihane <alanh@fairlite.demon.co.uk>
Fri, 6 Apr 2001 08:39:02 +0000 (08:39 +0000)
committerAlan Hourihane <alanh@fairlite.demon.co.uk>
Fri, 6 Apr 2001 08:39:02 +0000 (08:39 +0000)
linux-core/drmP.h
linux-core/drm_drv.c
linux/drmP.h
linux/drm_drv.h

index 085d1cb..227ec35 100644 (file)
@@ -999,12 +999,14 @@ extern int            DRM(proc_cleanup)(int minor,
                                        struct proc_dir_entry *root,
                                        struct proc_dir_entry *dev_root);
 
+#if __HAVE_SG
                                /* Scatter Gather Support (drm_scatter.h) */
 extern void           DRM(sg_cleanup)(drm_sg_mem_t *entry);
 extern int            DRM(sg_alloc)(struct inode *inode, struct file *filp,
                                    unsigned int cmd, unsigned long arg);
 extern int            DRM(sg_free)(struct inode *inode, struct file *filp,
                                   unsigned int cmd, unsigned long arg);
+#endif
 
                                /* ATI PCIGART support (ati_pcigart.h) */
 extern unsigned long  DRM(ati_pcigart_init)(drm_device_t *dev);
index 3791d7a..5337646 100644 (file)
@@ -424,10 +424,15 @@ static int DRM(takedown)( drm_device_t *dev )
                                 */
                                break;
                        case _DRM_SCATTER_GATHER:
+                               /* Handle it, but do nothing, if HAVE_SG
+                                * isn't defined.
+                                */
+#if __HAVE_SG
                                if(dev->sg) {
                                        DRM(sg_cleanup)(dev->sg);
                                        dev->sg = NULL;
                                }
+#endif
                                break;
                        }
                        DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);
index 085d1cb..227ec35 100644 (file)
@@ -999,12 +999,14 @@ extern int            DRM(proc_cleanup)(int minor,
                                        struct proc_dir_entry *root,
                                        struct proc_dir_entry *dev_root);
 
+#if __HAVE_SG
                                /* Scatter Gather Support (drm_scatter.h) */
 extern void           DRM(sg_cleanup)(drm_sg_mem_t *entry);
 extern int            DRM(sg_alloc)(struct inode *inode, struct file *filp,
                                    unsigned int cmd, unsigned long arg);
 extern int            DRM(sg_free)(struct inode *inode, struct file *filp,
                                   unsigned int cmd, unsigned long arg);
+#endif
 
                                /* ATI PCIGART support (ati_pcigart.h) */
 extern unsigned long  DRM(ati_pcigart_init)(drm_device_t *dev);
index 3791d7a..5337646 100644 (file)
@@ -424,10 +424,15 @@ static int DRM(takedown)( drm_device_t *dev )
                                 */
                                break;
                        case _DRM_SCATTER_GATHER:
+                               /* Handle it, but do nothing, if HAVE_SG
+                                * isn't defined.
+                                */
+#if __HAVE_SG
                                if(dev->sg) {
                                        DRM(sg_cleanup)(dev->sg);
                                        dev->sg = NULL;
                                }
+#endif
                                break;
                        }
                        DRM(free)(map, sizeof(*map), DRM_MEM_MAPS);