dsp_ctl_class = class_create(THIS_MODULE, "dspctl");
for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
- class_device_create(dsp_ctl_class, NULL,
+ device_create(dsp_ctl_class, NULL,
MKDEV(OMAP_DSP_CTL_MAJOR,
dev_list[i].minor),
- NULL, dev_list[i].devname);
+ dev_list[i].devname);
}
return 0;
int i;
for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
- class_device_destroy(dsp_ctl_class,
- MKDEV(OMAP_DSP_CTL_MAJOR,
- dev_list[i].minor));
+ device_destroy(dsp_ctl_class,
+ MKDEV(OMAP_DSP_CTL_MAJOR,
+ dev_list[i].minor));
}
class_destroy(dsp_ctl_class);
ret |= device_create_file(&dev->dev, &dev_attr_proc_list);
if (ret)
printk(KERN_ERR "device_create_file failed: %d\n", ret);
- class_device_create(dsp_task_class, NULL,
- MKDEV(OMAP_DSP_TASK_MAJOR, minor),
- NULL, "dsptask%d", minor);
+ device_create(dsp_task_class, NULL,
+ MKDEV(OMAP_DSP_TASK_MAJOR, minor),
+ "dsptask%d", minor);
init_waitqueue_head(&dev->state_wait_q);
init_rwsem(&dev->state_sem);
device_remove_file(&dev->dev, &dev_attr_devname);
device_remove_file(&dev->dev, &dev_attr_devstate);
device_remove_file(&dev->dev, &dev_attr_proc_list);
- class_device_destroy(dsp_task_class, MKDEV(OMAP_DSP_TASK_MAJOR, minor));
+ device_destroy(dsp_task_class, MKDEV(OMAP_DSP_TASK_MAJOR, minor));
device_unregister(&dev->dev);
proc_list_flush(&dev->proc_list_lock, &dev->proc_list);
taskdev[minor] = NULL;
/*
* sysfs files
*/
-static ssize_t mbox_attr_write(struct class_device *dev, const char *buf,
- size_t count)
+static ssize_t mbox_attr_write(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
int ret;
mbox_msg_t msg;
- struct omap_mbox *mbox = class_get_devdata(dev);
+ struct omap_mbox *mbox = dev_get_drvdata(dev);
msg = (mbox_msg_t) simple_strtoul(buf, NULL, 16);
return count;
}
-static ssize_t mbox_attr_read(struct class_device *dev, char *buf)
+static ssize_t mbox_attr_read(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
- struct omap_mbox *mbox = class_get_devdata(dev);
+ struct omap_mbox *mbox = dev_get_drvdata(dev);
return sprintf(buf, mbox->name);
}
-static CLASS_DEVICE_ATTR(mbox, S_IALLUGO, mbox_attr_read, mbox_attr_write);
+static DEVICE_ATTR(mbox, S_IALLUGO, mbox_attr_read, mbox_attr_write);
static ssize_t mbox_show(struct class *class, char *buf)
{
return ret;
}
- mbox->class_dev.class = &omap_mbox_class;
- strlcpy(mbox->class_dev.class_id, mbox->name, KOBJ_NAME_LEN);
- class_set_devdata(&mbox->class_dev, mbox);
+ mbox->dev.class = &omap_mbox_class;
+ strlcpy(mbox->dev.bus_id, mbox->name, KOBJ_NAME_LEN);
+ dev_set_drvdata(&mbox->dev, mbox);
- ret = class_device_register(&mbox->class_dev);
+ ret = device_register(&mbox->dev);
if (unlikely(ret))
return ret;
- ret = class_device_create_file(&mbox->class_dev, &class_device_attr_mbox);
+ ret = device_create_file(&mbox->dev, &dev_attr_mbox);
if (unlikely(ret)) {
printk(KERN_ERR
- "class_device_create_file failed: %d\n", ret);
+ "device_create_file failed: %d\n", ret);
goto fail1;
}