Skip to contentSkip to conversation

RTCAN_USE_REFCOUNT issue in rtcan_dev.h

Xenomai-core Applied Matthias Fuchs 3 participants 3 messages Sep 12, 2006

lore
Share & tools
lore
#0 lore raw

Hi Jan,

I think there's is little typo in rtcan_dev.h:

rtcan_dev.h (working copy) renamed from rtcan_dev.h (revision 1564) +1 -1
Index: rtcan_dev.h
===================================================================
@@ -45,7 +45,7 @@
 
 /* Suppress handling of refcount if module support is not enabled
  * or modules cannot be unloaded */
-#if defined(CONFIG_MODULES) && !defined(CONFIG_MODULE_UNLOAD)
+#if defined(CONFIG_MODULES) && defined(CONFIG_MODULE_UNLOAD)
 #define RTCAN_USE_REFCOUNT
 #endif
 

This simple patch will allow unloading of modules.

Matthias

#1 lore raw
Quoted 18 lines · Matthias Fuchs

Hi Jan,

I think there's is little typo in rtcan_dev.h:

Index: rtcan_dev.h
===================================================================

rtcan_dev.h (working copy) renamed from rtcan_dev.h (revision 1564) +1 -1
@@ -45,7 +45,7 @@
 
 /* Suppress handling of refcount if module support is not enabled
  * or modules cannot be unloaded */
-#if defined(CONFIG_MODULES) && !defined(CONFIG_MODULE_UNLOAD)
+#if defined(CONFIG_MODULES) && defined(CONFIG_MODULE_UNLOAD)
 #define RTCAN_USE_REFCOUNT
 #endif
 
Quoted 1 line

This simple patch will allow unloading of modules.

Argh, I interpreted the meaning of CONFIG_MODULE_UNLOAD the other way round. But your fix will not work for 2.4, as there is no CONFIG_MODULE_UNLOAD. The attached one should be OK.

Thanks.

Wolfgang.

+ diff -u xenomai/ksrc/drivers/can/rtcan_dev.h.REFCOUNT xenomai/ksrc/drivers/can/rtcan_dev.h

ksrc/drivers/can/rtcan_dev.h renamed from ksrc/drivers/can/rtcan_dev.h.REFCOUNT +3 -1
@@ -45,7 +45,9 @@
 
 /* Suppress handling of refcount if module support is not enabled
  * or modules cannot be unloaded */
-#if defined(CONFIG_MODULES) && !defined(CONFIG_MODULE_UNLOAD)
+
+#ifdef CONFIG_MODULES
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) || defined(CONFIG_MODULE_UNLOAD)
 #define RTCAN_USE_REFCOUNT
 #endif
 
Applied
#2 lore raw
Quoted 25 lines · Wolfgang Grandegger
Quoted 18 lines · Matthias Fuchs

Hi Jan,

I think there's is little typo in rtcan_dev.h:

Index: rtcan_dev.h
===================================================================

rtcan_dev.h (working copy) renamed from rtcan_dev.h (revision 1564) +1 -1
@@ -45,7 +45,7 @@
 
 /* Suppress handling of refcount if module support is not enabled
  * or modules cannot be unloaded */
-#if defined(CONFIG_MODULES) && !defined(CONFIG_MODULE_UNLOAD)
+#if defined(CONFIG_MODULES) && defined(CONFIG_MODULE_UNLOAD)
 #define RTCAN_USE_REFCOUNT
 #endif
 
Quoted 1 line

This simple patch will allow unloading of modules.

Argh, I interpreted the meaning of CONFIG_MODULE_UNLOAD the other way round. But your fix will not work for 2.4, as there is no CONFIG_MODULE_UNLOAD. The attached one should be OK.

Quoted 4 lines

Thanks.

Wolfgang.

Applied, thanks to both of you.

Jan