aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2015-01-04 09:04:34 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-01-13 05:52:42 -0500
commita8fc91afab2f6bc50ce5b5be86dd7fc4af159c70 (patch)
tree58d356105e193c9e08a696870ce95fd3708f6ee4 /drivers/video
parenteaa27f34e91a14cdceed26ed6c6793ec1d186115 (diff)
atyfb: mark DMI system id table as __initconst
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/aty/atyfb_base.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 37ec09b3fffd..8789e487b96e 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -3948,7 +3948,7 @@ static struct notifier_block atyfb_reboot_notifier = {
3948 .notifier_call = atyfb_reboot_notify, 3948 .notifier_call = atyfb_reboot_notify,
3949}; 3949};
3950 3950
3951static const struct dmi_system_id atyfb_reboot_ids[] = { 3951static const struct dmi_system_id atyfb_reboot_ids[] __initconst = {
3952 { 3952 {
3953 .ident = "HP OmniBook 500", 3953 .ident = "HP OmniBook 500",
3954 .matches = { 3954 .matches = {
@@ -3960,6 +3960,7 @@ static const struct dmi_system_id atyfb_reboot_ids[] = {
3960 3960
3961 { } 3961 { }
3962}; 3962};
3963static bool registered_notifier = false;
3963 3964
3964static int __init atyfb_init(void) 3965static int __init atyfb_init(void)
3965{ 3966{
@@ -3982,15 +3983,17 @@ static int __init atyfb_init(void)
3982 if (err1 && err2) 3983 if (err1 && err2)
3983 return -ENODEV; 3984 return -ENODEV;
3984 3985
3985 if (dmi_check_system(atyfb_reboot_ids)) 3986 if (dmi_check_system(atyfb_reboot_ids)) {
3986 register_reboot_notifier(&atyfb_reboot_notifier); 3987 register_reboot_notifier(&atyfb_reboot_notifier);
3988 registered_notifier = true;
3989 }
3987 3990
3988 return 0; 3991 return 0;
3989} 3992}
3990 3993
3991static void __exit atyfb_exit(void) 3994static void __exit atyfb_exit(void)
3992{ 3995{
3993 if (dmi_check_system(atyfb_reboot_ids)) 3996 if (registered_notifier)
3994 unregister_reboot_notifier(&atyfb_reboot_notifier); 3997 unregister_reboot_notifier(&atyfb_reboot_notifier);
3995 3998
3996#ifdef CONFIG_PCI 3999#ifdef CONFIG_PCI