diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-04 02:21:14 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-04 02:25:36 -0500 |
commit | 7705d548cbe33f18ea7713b9a07aa11047aaeca4 (patch) | |
tree | 2d7b4337e74f6075f28718974a8c159f07c5eeda /drivers/input/mouse/lifebook.c | |
parent | f72a28aba92d5a599c8a772e443aa8f079b3091f (diff) |
Input: psmouse - do not carry DMI data around
DMI tables use considerable amount of memory. Mark them as __initconst
so they will be discarded once module is loaded.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/lifebook.c')
-rw-r--r-- | drivers/input/mouse/lifebook.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 54b7f64d6e62..cd81cefdc1c5 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -25,11 +25,13 @@ struct lifebook_data { | |||
25 | char phys[32]; | 25 | char phys[32]; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | static bool lifebook_present; | ||
29 | |||
28 | static const char *desired_serio_phys; | 30 | static const char *desired_serio_phys; |
29 | 31 | ||
30 | static int lifebook_set_serio_phys(const struct dmi_system_id *d) | 32 | static int lifebook_limit_serio3(const struct dmi_system_id *d) |
31 | { | 33 | { |
32 | desired_serio_phys = d->driver_data; | 34 | desired_serio_phys = "isa0060/serio3"; |
33 | return 0; | 35 | return 0; |
34 | } | 36 | } |
35 | 37 | ||
@@ -41,7 +43,8 @@ static int lifebook_set_6byte_proto(const struct dmi_system_id *d) | |||
41 | return 0; | 43 | return 0; |
42 | } | 44 | } |
43 | 45 | ||
44 | static const struct dmi_system_id lifebook_dmi_table[] = { | 46 | static const struct dmi_system_id __initconst lifebook_dmi_table[] = { |
47 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
45 | { | 48 | { |
46 | .ident = "FLORA-ie 55mi", | 49 | .ident = "FLORA-ie 55mi", |
47 | .matches = { | 50 | .matches = { |
@@ -83,8 +86,7 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
83 | .matches = { | 86 | .matches = { |
84 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), | 87 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), |
85 | }, | 88 | }, |
86 | .callback = lifebook_set_serio_phys, | 89 | .callback = lifebook_limit_serio3, |
87 | .driver_data = "isa0060/serio3", | ||
88 | }, | 90 | }, |
89 | { | 91 | { |
90 | .ident = "Panasonic CF-28", | 92 | .ident = "Panasonic CF-28", |
@@ -116,8 +118,14 @@ static const struct dmi_system_id lifebook_dmi_table[] = { | |||
116 | }, | 118 | }, |
117 | }, | 119 | }, |
118 | { } | 120 | { } |
121 | #endif | ||
119 | }; | 122 | }; |
120 | 123 | ||
124 | void __init lifebook_module_init(void) | ||
125 | { | ||
126 | lifebook_present = dmi_check_system(lifebook_dmi_table); | ||
127 | } | ||
128 | |||
121 | static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) | 129 | static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) |
122 | { | 130 | { |
123 | struct lifebook_data *priv = psmouse->private; | 131 | struct lifebook_data *priv = psmouse->private; |
@@ -243,7 +251,7 @@ static void lifebook_disconnect(struct psmouse *psmouse) | |||
243 | 251 | ||
244 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) | 252 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) |
245 | { | 253 | { |
246 | if (!dmi_check_system(lifebook_dmi_table)) | 254 | if (!lifebook_present) |
247 | return -1; | 255 | return -1; |
248 | 256 | ||
249 | if (desired_serio_phys && | 257 | if (desired_serio_phys && |