radeon: add Android build support
[platform/upstream/libdrm.git] / xf86drm.c
index 720952f..85beb8c 100644 (file)
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -104,12 +104,16 @@ void drmSetServerInfo(drmServerInfoPtr info)
  * This function is a wrapper around vfprintf().
  */
 
-static int drmDebugPrint(const char *format, va_list ap)
+static int DRM_PRINTFLIKE(1, 0)
+drmDebugPrint(const char *format, va_list ap)
 {
     return vfprintf(stderr, format, ap);
 }
 
-static int (*drm_debug_print)(const char *format, va_list ap) = drmDebugPrint;
+typedef int DRM_PRINTFLIKE(1, 0) (*debug_msg_func_t)(const char *format,
+                                                    va_list ap);
+
+static debug_msg_func_t drm_debug_print = drmDebugPrint;
 
 void
 drmMsg(const char *format, ...)
@@ -129,7 +133,7 @@ drmMsg(const char *format, ...)
 }
 
 void
-drmSetDebugMsgFunction(int (*debug_msg_ptr)(const char *format, va_list ap))
+drmSetDebugMsgFunction(debug_msg_func_t debug_msg_ptr)
 {
     drm_debug_print = debug_msg_ptr;
 }
@@ -499,7 +503,7 @@ static int drmOpenByBusid(const char *busid)
                sv.drm_di_minor = 1;
                sv.drm_dd_major = -1;       /* Don't care */
                sv.drm_dd_minor = -1;       /* Don't care */
-               drmMsg("drmOpenByBusid: Interface 1.4 failed, trying 1.1\n",fd);
+               drmMsg("drmOpenByBusid: Interface 1.4 failed, trying 1.1\n");
                drmSetInterfaceVersion(fd, &sv);
            }
            buf = drmGetBusid(fd);
@@ -537,19 +541,6 @@ static int drmOpenByName(const char *name)
     int           fd;
     drmVersionPtr version;
     char *        id;
-    
-    if (!drmAvailable()) {
-       if (!drm_server_info) {
-           return -1;
-       }
-       else {
-           /* try to load the kernel module now */
-           if (!drm_server_info->load_module(name)) {
-               drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
-               return -1;
-           }
-       }
-    }
 
     /*
      * Open the first minor number that matches the driver name and isn't