[PATCH libdrm 08/12] xf86drm: move ifdef __linux__ guards where needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Emil Velikov <emil.l.velikov@xxxxxxxxx>
---
 xf86drm.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 8105b42..3d03cbf 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2836,9 +2836,9 @@ char *drmGetRenderDeviceNameFromFd(int fd)
 	return drmGetMinorNameForFD(fd, DRM_NODE_RENDER);
 }
 
-#ifdef __linux__
 static int drmParseSubsystemType(int maj, int min)
 {
+#ifdef __linux__
     char path[PATH_MAX + 1];
     char link[PATH_MAX + 1] = "";
     char *name;
@@ -2857,10 +2857,15 @@ static int drmParseSubsystemType(int maj, int min)
         return DRM_BUS_PCI;
 
     return -EINVAL;
+#else
+#warning "Missing implementation of drmParseSubsystemType"
+    return -EINVAL;
+#endif
 }
 
 static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info)
 {
+#ifdef __linux__
     char path[PATH_MAX + 1];
     char data[128];
     char *str;
@@ -2893,6 +2898,10 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info)
     info->func = func;
 
     return 0;
+#else
+#warning "Missing implementation of drmParsePciBusInfo"
+    return -EINVAL;
+#endif
 }
 
 static int drmCompareBusInfo(drmDevicePtr a, drmDevicePtr b)
@@ -2942,6 +2951,7 @@ static int drmGetMaxNodeName(void)
 static int drmParsePciDeviceInfo(const char *d_name,
                                  drmPciDeviceInfoPtr device)
 {
+#ifdef __linux__
     char path[PATH_MAX + 1];
     unsigned char config[64];
     int fd, ret;
@@ -2963,6 +2973,10 @@ static int drmParsePciDeviceInfo(const char *d_name,
     device->subdevice_id = config[46] | (config[47] << 8);
 
     return 0;
+#else
+#warning "Missing implementation of drmParsePciDeviceInfo"
+    return -EINVAL;
+#endif
 }
 
 static void drmFreeDevice(drmDevicePtr *device)
@@ -3139,20 +3153,3 @@ close_sysdir:
     closedir(sysdir);
     return ret;
 }
-#else
-void drmFreeDevices(drmDevicePtr devices[], int count)
-{
-    (void)devices;
-    (void)count;
-}
-
-int drmGetDevices(drmDevicePtr devices[], int max_devices)
-{
-    (void)devices;
-    (void)max_devices;
-    return -EINVAL;
-}
-
-#warning "Missing implementation of drmGetDevices/drmFreeDevices"
-
-#endif
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux