#include <linux/list.h>
#include <linux/of.h>
-static struct class *devfreq_event_class;
+static struct attribute *devfreq_event_attrs[];
+ATTRIBUTE_GROUPS(devfreq_event);
+
+static const struct class devfreq_event_class = {
+ .name = "devfreq-event",
+ .dev_groups = devfreq_event_groups
+};
/* The list of all devfreq event list */
static LIST_HEAD(devfreq_event_list);
edev->desc = desc;
edev->enable_count = 0;
edev->dev.parent = dev;
- edev->dev.class = devfreq_event_class;
+ edev->dev.class = &devfreq_event_class;
edev->dev.release = devfreq_event_release_edev;
dev_set_name(&edev->dev, "event%d", atomic_inc_return(&event_no));
&dev_attr_enable_count.attr,
NULL,
};
-ATTRIBUTE_GROUPS(devfreq_event);
static int __init devfreq_event_init(void)
{
- devfreq_event_class = class_create("devfreq-event");
- if (IS_ERR(devfreq_event_class)) {
- pr_err("%s: couldn't create class\n", __FILE__);
- return PTR_ERR(devfreq_event_class);
- }
+ int err;
- devfreq_event_class->dev_groups = devfreq_event_groups;
+ err = class_register(&devfreq_event_class);
+ if (err)
+ pr_err("%s: couldn't create class\n", __FILE__);
- return 0;
+ return err;
}
subsys_initcall(devfreq_event_init);