diff options
Diffstat (limited to 'drivers/firmware/dmi-id.c')
-rw-r--r-- | drivers/firmware/dmi-id.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index b6e1eb77d148..313c99cbdc62 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c | |||
@@ -173,14 +173,11 @@ static struct device *dmi_dev; | |||
173 | if (dmi_get_system_info(_field)) \ | 173 | if (dmi_get_system_info(_field)) \ |
174 | sys_dmi_attributes[i++] = &sys_dmi_##_name##_attr.dev_attr.attr; | 174 | sys_dmi_attributes[i++] = &sys_dmi_##_name##_attr.dev_attr.attr; |
175 | 175 | ||
176 | extern int dmi_available; | 176 | /* In a separate function to keep gcc 3.2 happy - do NOT merge this in |
177 | 177 | dmi_id_init! */ | |
178 | static int __init dmi_id_init(void) | 178 | static void __init dmi_id_init_attr_table(void) |
179 | { | 179 | { |
180 | int ret, i; | 180 | int i; |
181 | |||
182 | if (!dmi_available) | ||
183 | return -ENODEV; | ||
184 | 181 | ||
185 | /* Not necessarily all DMI fields are available on all | 182 | /* Not necessarily all DMI fields are available on all |
186 | * systems, hence let's built an attribute table of just | 183 | * systems, hence let's built an attribute table of just |
@@ -205,6 +202,16 @@ static int __init dmi_id_init(void) | |||
205 | ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL); | 202 | ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL); |
206 | ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG); | 203 | ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG); |
207 | sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr; | 204 | sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr; |
205 | } | ||
206 | |||
207 | static int __init dmi_id_init(void) | ||
208 | { | ||
209 | int ret; | ||
210 | |||
211 | if (!dmi_available) | ||
212 | return -ENODEV; | ||
213 | |||
214 | dmi_id_init_attr_table(); | ||
208 | 215 | ||
209 | ret = class_register(&dmi_class); | 216 | ret = class_register(&dmi_class); |
210 | if (ret) | 217 | if (ret) |