• A
    eeepc-laptop: fix ordering of init and exit functions · 1e779854
    Alan Jenkins 提交于
    1. input and backlight devices were registered after acpi notifications
       are enabled.  This left a window where eeepc_hotk_notify() might
       find these devices in an inconsistent (half-initialized) state.
    
    -> Move all device registration into eeepc_hotk_add(), which is called
       before enabling acpi notifications.
    
    2. input and backlight devices were unregistered before acpi
       notifications are disabled.  This left a window where
       eeepc_hotk_notify() might find these devices in an inconsistent
       (half-destroyed) state.
    
    -> Move all device unregistration into eeepc_hotk_remove(), which is
       called after disabling acpi notifications.
    
    3. The acpi driver was not freed if an error occured further down in
       eeepc_laptop_init().
    
    -> The rest of eeepc_laptop_init() has been moved to eeepc_hotk_add(),
       so this is no longer a problem.
    
    4. The acpi driver was unregistered before the platform driver.  This
       left a window where a sysfs access could attempt to read the ehotk
       structure after it had been freed by eeepc_hotk_remove().
    
    -> The acpi driver is now unregistered as the last step in
       eeepc_laptop_exit(), so this is no longer a problem.
    Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
    Signed-off-by: NCorentin Chary <corentincj@iksaif.net>
    Signed-off-by: NLen Brown <len.brown@intel.com>
    1e779854
eeepc-laptop.c 28.8 KB