[MPlayer-dev-eng] NOVIRUS [ftempel at linuxops.net: mga_vid patch for 2.6.0-test7 - with patch this time]

Kronos kronos at kronoz.cjb.net
Sat Oct 18 22:38:18 CEST 2003


Il Sat, Oct 18, 2003 at 08:58:01PM +0200, Gabucino ha scritto: 
> Attached a new patch for the mga_vid module to make it work with
> 2.6.0-test(7) kernels.

--- mga_vid.c	2003-10-18 16:00:08.000000000 +0200
+++ mga_vid.c	2003-10-18 15:58:58.000000000 +0200
[cut]
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	MOD_DEC_USE_COUNT;
+#else
+	try_module_get(THIS_MODULE);
+#endif
 	return 0;
 }
 
@@ -1507,7 +1538,7 @@
 {
 	mga_card_t * card;
 	
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	int minor = MINOR(inode->i_rdev.value);
 #else
 	int minor = MINOR(inode->i_rdev);
@@ -1539,7 +1570,11 @@
 		return(-EBUSY);
 
 	card->vid_in_use = 1;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 	MOD_INC_USE_COUNT;
+#else
+	module_put(THIS_MODULE);
+#endif
 	return(0);
 }

This is wrong. In 2.6 the locking is  done by the char dev layer, please
remove try_module_get/module_put.

Luca
-- 
Reply-To: kronos at kronoz.cjb.net
Home: http://kronoz.cjb.net
Se alla sera, dopo una strepitosa vittoria, guardandoti allo
specchio dovessi notare un secondo paio di palle, che il tuo 
cuore non si riempia d'orgoglio, perche` vuol dire che ti 
stanno inculando -- Saggio Cinese



More information about the MPlayer-dev-eng mailing list