Skip to contentSkip to conversation

input: function call order in serio_exit()

PATCH In review Németh Márton 2 participants 2 messages Oct 22, 2006 – Oct 23, 2006 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input: function call order in serio_exit()

Hi,

the order of the bus registration and the kthread start was changed between linux kernel 2.6.17.11 and 2.6.18. The order is now first register the bus and then start the kthread. The serio_exit() left unchanged.

I think that the order of the function calls in serio_exit() should also be changed: first stop the kthread and then unregister the bus.

What do you think?

NMarci

drivers/input/serio/serio.c +1 -1
@@ -958,8 +958,8 @@ static int __init serio_init(void)
 
 static void __exit serio_exit(void)
 {
-	bus_unregister(&serio_bus);
 	kthread_stop(serio_task);
+	bus_unregister(&serio_bus);
 }
 
 subsys_initcall(serio_init);
#1 lore raw
Quoted 7 lines · Németh Márton

Hi,

the order of the bus registration and the kthread start was changed between linux kernel 2.6.17.11 and 2.6.18. The order is now first register the bus and then start the kthread. The serio_exit() left unchanged.

Quoted 5 lines

I think that the order of the function calls in serio_exit() should also be changed: first stop the kthread and then unregister the bus.

What do you think?

Hi,

It really does not matter - if bus is unregistered that means the there are no drivers using it and so noone can submit new requests to kseriod.

I'd leave it as is.

Signature · 1 line
Dmitry