static void taskdev_attach_task(struct taskdev *dev, struct dsptask *task);
static void taskdev_detach_task(struct taskdev *dev);
-static ssize_t devname_show(struct device *d, char *buf);
-static ssize_t devstate_show(struct device *d, char *buf);
-static ssize_t proc_list_show(struct device *d, char *buf);
-static ssize_t taskname_show(struct device *d, char *buf);
-static ssize_t ttyp_show(struct device *d, char *buf);
-static ssize_t fifosz_show(struct device *d, char *buf);
-static int fifosz_store(struct device *d, const char *buf, size_t count);
-static ssize_t fifocnt_show(struct device *d, char *buf);
-static ssize_t ipblink_show(struct device *d, char *buf);
-static ssize_t wsz_show(struct device *d, char *buf);
-static ssize_t mmap_show(struct device *d, char *buf);
+static ssize_t devname_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t devstate_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t proc_list_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t taskname_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t ttyp_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t fifosz_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static int fifosz_store(struct device *d, struct device_attribute *attr,
+ const char *buf, size_t count);
+static ssize_t fifocnt_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t ipblink_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t wsz_show(struct device *d, struct device_attribute *attr,
+ char *buf);
+static ssize_t mmap_show(struct device *d, struct device_attribute *attr,
+ char *buf);
static struct device_attribute dev_attr_devname = __ATTR_RO(devname);
static struct device_attribute dev_attr_devstate = __ATTR_RO(devstate);
.name = "dsptask",
};
-static struct class_simple *dsp_task_class;
+static struct class *dsp_task_class;
static struct taskdev *taskdev[TASKDEV_MAX];
static struct dsptask *dsptask[TASKDEV_MAX];
static DECLARE_MUTEX(cfg_sem);
device_create_file(&dev->dev, &dev_attr_devname);
device_create_file(&dev->dev, &dev_attr_devstate);
device_create_file(&dev->dev, &dev_attr_proc_list);
- class_simple_device_add(dsp_task_class,
- MKDEV(OMAP_DSP_TASK_MAJOR, minor), NULL,
- "dsptask%d", minor);
+ class_device_create(dsp_task_class, MKDEV(OMAP_DSP_TASK_MAJOR, minor),
+ NULL, "dsptask%d", minor);
devfs_mk_cdev(MKDEV(OMAP_DSP_TASK_MAJOR, minor),
S_IFCHR | S_IRUGO | S_IWUGO, "dsptask%d", minor);
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));
devfs_remove("dsptask%d", minor);
device_unregister(&dev->dev);
proc_list_flush(&dev->proc_list);
/*
* sysfs files
*/
-static ssize_t devname_show(struct device *d, char *buf)
+static ssize_t devname_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct taskdev *dev = to_taskdev(d);
return sprintf(buf, "%s\n", dev->name);
((stat) == OMAP_DSP_DEVSTATE_ADDFAIL) ? "ADDFAIL" :\
"unknown")
-static ssize_t devstate_show(struct device *d, char *buf)
+static ssize_t devstate_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct taskdev *dev = to_taskdev(d);
return sprintf(buf, "%s\n", devstate_name(dev->state));
}
-static ssize_t proc_list_show(struct device *d, char *buf)
+static ssize_t proc_list_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct taskdev *dev;
struct proc_list *pl;
return len;
}
-static ssize_t taskname_show(struct device *d, char *buf)
+static ssize_t taskname_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct taskdev *dev = to_taskdev(d);
int len;
return len;
}
-static ssize_t ttyp_show(struct device *d, char *buf)
+static ssize_t ttyp_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
unsigned short ttyp = to_taskdev(d)->task->ttyp;
int len = 0;
return len;
}
-static ssize_t fifosz_show(struct device *d, char *buf)
+static ssize_t fifosz_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct fifo_struct *fifo = &to_taskdev(d)->task->rcvdt.fifo;
return sprintf(buf, "%d\n", fifo->sz);
}
-static int fifosz_store(struct device *d, const char *buf, size_t count)
+static int fifosz_store(struct device *d, struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct dsptask *task = to_taskdev(d)->task;
unsigned long fifosz;
return (ret < 0) ? ret : strlen(buf);
}
-static ssize_t fifocnt_show(struct device *d, char *buf)
+static ssize_t fifocnt_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct fifo_struct *fifo = &to_taskdev(d)->task->rcvdt.fifo;
return sprintf(buf, "%d\n", fifo->cnt);
}
}
-static ssize_t ipblink_show(struct device *d, char *buf)
+static ssize_t ipblink_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct rcvdt_bk_struct *rcvdt = &to_taskdev(d)->task->rcvdt.bk;
int len;
return len;
}
-static ssize_t wsz_show(struct device *d, char *buf)
+static ssize_t wsz_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
return sprintf(buf, "%d\n", to_taskdev(d)->task->wsz);
}
-static ssize_t mmap_show(struct device *d, char *buf)
+static ssize_t mmap_show(struct device *d, struct device_attribute *attr,
+ char *buf)
{
struct dsptask *task = to_taskdev(d)->task;
return sprintf(buf, "0x%p 0x%x\n", task->map_base, task->map_length);
unregister_chrdev(OMAP_DSP_TASK_MAJOR, "dsptask");
return -EINVAL;
}
- dsp_task_class = class_simple_create(THIS_MODULE, "dsptask");
+ dsp_task_class = class_create(THIS_MODULE, "dsptask");
devfs_mk_dir("dsptask");
return 0;
void dsp_taskmod_exit(void)
{
devfs_remove("dsptask");
- class_simple_destroy(dsp_task_class);
+ class_destroy(dsp_task_class);
driver_unregister(&dsptask_driver);
bus_unregister(&dsptask_bus);
unregister_chrdev(OMAP_DSP_TASK_MAJOR, "dsptask");