@@ -896,14 +896,13 @@ EXPORT_SYMBOL(dmi_name_in_vendors);
* A new search is initiated by passing %NULL as the @from argument.
* If @from is not %NULL, searches continue from next device.
*/
-const struct dmi_device *dmi_find_device(int type, const char *name,
- const struct dmi_device *from)
+struct dmi_device *dmi_find_device(int type, const char *name,
+ const struct dmi_device *from)
{
- const struct list_head *head = from ? &from->list : &dmi_devices;
- struct list_head *d;
+ struct list_head *d = from ? from->list.next : dmi_devices.next;
- for (d = head->next; d != &dmi_devices; d = d->next) {
- const struct dmi_device *dev =
+ for (; d != &dmi_devices; d = d->next) {
+ struct dmi_device *dev =
list_entry(d, struct dmi_device, list);
if (((type == DMI_DEV_TYPE_ANY) || (dev->type == type)) &&
@@ -98,9 +98,9 @@ struct dmi_dev_onboard {
extern struct kobject *dmi_kobj;
extern int dmi_check_system(const struct dmi_system_id *list);
const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
-extern const char * dmi_get_system_info(int field);
-extern const struct dmi_device * dmi_find_device(int type, const char *name,
- const struct dmi_device *from);
+extern const char *dmi_get_system_info(int field);
+extern struct dmi_device *dmi_find_device(int type, const char *name,
+ const struct dmi_device *from);
extern void dmi_scan_machine(void);
extern void dmi_memdev_walk(void);
extern void dmi_set_dump_stack_arch_desc(void);
@@ -116,8 +116,8 @@ extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
#else
static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
-static inline const char * dmi_get_system_info(int field) { return NULL; }
-static inline const struct dmi_device * dmi_find_device(int type, const char *name,
+static inline const char *dmi_get_system_info(int field) { return NULL; }
+static inline struct dmi_device *dmi_find_device(int type, const char *name,
const struct dmi_device *from) { return NULL; }
static inline void dmi_scan_machine(void) { return; }
static inline void dmi_memdev_walk(void) { }