atyfb: mark DMI system id table as __initconst
authorMathias Krause <minipli@googlemail.com>
Sun, 4 Jan 2015 14:04:34 +0000 (15:04 +0100)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 13 Jan 2015 10:52:42 +0000 (12:52 +0200)
We can mark the DMI system id table as __initconst by using a helper
variable that'll tell us if we need to unregister the reboot notifier in
atyfb_exit() instead of matching the DMI system id again.

This frees up ~680 bytes of runtime memory, the DMI table occupies.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/aty/atyfb_base.c

index 37ec09b3fffd2b4204a717953b3d67b2009a3bdd..8789e487b96e98f12d639530d21b792c15d1e60b 100644 (file)
@@ -3948,7 +3948,7 @@ static struct notifier_block atyfb_reboot_notifier = {
        .notifier_call = atyfb_reboot_notify,
 };
 
-static const struct dmi_system_id atyfb_reboot_ids[] = {
+static const struct dmi_system_id atyfb_reboot_ids[] __initconst = {
        {
                .ident = "HP OmniBook 500",
                .matches = {
@@ -3960,6 +3960,7 @@ static const struct dmi_system_id atyfb_reboot_ids[] = {
 
        { }
 };
+static bool registered_notifier = false;
 
 static int __init atyfb_init(void)
 {
@@ -3982,15 +3983,17 @@ static int __init atyfb_init(void)
        if (err1 && err2)
                return -ENODEV;
 
-       if (dmi_check_system(atyfb_reboot_ids))
+       if (dmi_check_system(atyfb_reboot_ids)) {
                register_reboot_notifier(&atyfb_reboot_notifier);
+               registered_notifier = true;
+       }
 
        return 0;
 }
 
 static void __exit atyfb_exit(void)
 {
-       if (dmi_check_system(atyfb_reboot_ids))
+       if (registered_notifier)
                unregister_reboot_notifier(&atyfb_reboot_notifier);
 
 #ifdef CONFIG_PCI
This page took 0.028935 seconds and 5 git commands to generate.