Reputation: 636
I have a loadable linux module which controls some hardware. I need to run some code before a soft reboot, however, I noticed the module destructor does not seem to be called in this situation, so I'm wondering how to have the driver informed before the reboot occurs.
Upvotes: 2
Views: 4660
Reputation: 64700
You want register_reboot_notifier()
. For an example you can look here: see lines 181, 142, 129.
Upvotes: 4