Merge branch 'mfd/wm8994' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[linux-2.6.git] / drivers / firmware / dmi-id.c
index e880d6c..94a58a0 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/dmi.h>
 #include <linux/device.h>
+#include <linux/slab.h>
 
 struct dmi_device_attribute{
        struct device_attribute dev_attr;
@@ -139,7 +140,7 @@ static struct attribute_group sys_dmi_attribute_group = {
        .attrs = sys_dmi_attributes,
 };
 
-static struct attribute_group* sys_dmi_attribute_groups[] = {
+static const struct attribute_group* sys_dmi_attribute_groups[] = {
        &sys_dmi_attribute_group,
        NULL
 };
@@ -223,15 +224,17 @@ static int __init dmi_id_init(void)
        }
 
        dmi_dev->class = &dmi_class;
-       strcpy(dmi_dev->bus_id, "id");
+       dev_set_name(dmi_dev, "id");
        dmi_dev->groups = sys_dmi_attribute_groups;
 
        ret = device_register(dmi_dev);
        if (ret)
-               goto fail_class_unregister;
+               goto fail_free_dmi_dev;
 
        return 0;
 
+fail_free_dmi_dev:
+       kfree(dmi_dev);
 fail_class_unregister:
 
        class_unregister(&dmi_class);