Skip to contentSkip to conversation

drivers/ide/ide-probe.c MOD_INC/DEC_USE_COUNT fixup

PATCH New Omkhar Arasaratnam 1 participant 1 message Dec 29, 2003 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/ide/ide-probe.c MOD_INC/DEC_USE_COUNT fixup

Minor fixup to replace MOD_DEC_USE_COUNT/MOD_INC_USE_COUNT with module_put(THIS_MODULE) and try_module_get(THIS_MODULE)

I am new are this so feel free to tell me if I have done something incorrectly.

This is mainly to clean up compiler #warnings since MOD_*_USE_COUNT macros are depreciated in 2.6

drivers/ide/ide-probe.c renamed from drivers/ide/ide-probe.c.org +2 -2
@@ -1323,7 +1323,7 @@
 	unsigned int index;
 	int probe[MAX_HWIFS];
 	
-	MOD_INC_USE_COUNT;
+	try_module_get(THIS_MODULE);
 	memset(probe, 0, MAX_HWIFS * sizeof(int));
 	for (index = 0; index < MAX_HWIFS; ++index)
 		probe[index] = !ide_hwifs[index].present;
@@ -1350,7 +1350,7 @@
 	}
 	if (!ide_probe)
 		ide_probe = &ideprobe_init;
-	MOD_DEC_USE_COUNT;
+	module_put(THIS_MODULE);
 	return 0;
 }
 

O