]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Updated DSP to use class_device instead of class_simple
authorToshihiro Kobayashi <Toshihiro.Kobayashi@nokia.com>
Thu, 30 Jun 2005 13:20:40 +0000 (06:20 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 30 Jun 2005 13:20:40 +0000 (06:20 -0700)
Updated DSP to use class_device instead of class_simple

arch/arm/mach-omap/dsp/dsp_ctl.c
arch/arm/mach-omap/dsp/dsp_ctl_core.c
arch/arm/mach-omap/dsp/dsp_mem.c
arch/arm/mach-omap/dsp/ipbuf.c
arch/arm/mach-omap/dsp/mblog.c
arch/arm/mach-omap/dsp/task.c

index f9fe7c6a475b0f969c8b1599f00ac1c7b375c42e..985b852a8fd0dc5983009f1ed145083042cd7f95 100644 (file)
@@ -42,7 +42,8 @@
 #include "dsp.h"
 #include "ipbuf.h"
 
-static ssize_t loadinfo_show(struct device *dev, char *buf);
+static ssize_t loadinfo_show(struct device *dev, struct device_attribute *attr,
+                            char *buf);
 static struct device_attribute dev_attr_loadinfo = __ATTR_RO(loadinfo);
 extern struct device_attribute dev_attr_ipbuf;
 
@@ -754,7 +755,8 @@ void mbx1_getvar(struct mbcmd *mb)
 /*
  * sysfs files
  */
-static ssize_t ifver_show(struct device *dev, char *buf)
+static ssize_t ifver_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        int len = 0;
 
@@ -778,7 +780,8 @@ static ssize_t ifver_show(struct device *dev, char *buf)
 
 static struct device_attribute dev_attr_ifver = __ATTR_RO(ifver);
 
-static ssize_t icrmask_show(struct device *dev, char *buf)
+static ssize_t icrmask_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
 {
 #if 0
        if (dsp_is_ready()) {
@@ -795,7 +798,8 @@ static ssize_t icrmask_show(struct device *dev, char *buf)
        return sprintf(buf, "0x%04x\n", dsp_icrmask);
 }
 
-static ssize_t icrmask_store(struct device *dev, const char *buf, size_t count)
+static ssize_t icrmask_store(struct device *dev, struct device_attribute *attr,
+                            const char *buf, size_t count)
 {
        int ret;
 
@@ -816,7 +820,8 @@ static ssize_t icrmask_store(struct device *dev, const char *buf, size_t count)
 static struct device_attribute dev_attr_icrmask = 
        __ATTR(icrmask, S_IWUSR | S_IRUGO, icrmask_show, icrmask_store);
 
-static ssize_t loadinfo_show(struct device *dev, char *buf)
+static ssize_t loadinfo_show(struct device *dev, struct device_attribute *attr,
+                            char *buf)
 {
        int len;
        int ret;
index 729ad9fcf0b43a061fdac076e61b3cb03dd13e39..88df7cbba4b042879556f80f7bfdd17754dbdf9e 100644 (file)
@@ -38,7 +38,7 @@
 #define TWCH_MINOR     2
 #define ERR_MINOR      3
 
-static struct class_simple *dsp_ctl_class;
+static struct class *dsp_ctl_class;
 extern struct file_operations dsp_ctl_fops,
                              dsp_mem_fops,
                              dsp_twch_fops,
@@ -98,13 +98,13 @@ int __init dsp_ctl_core_init(void)
                return retval;
        }
 
-       dsp_ctl_class = class_simple_create(THIS_MODULE, "dspctl");
+       dsp_ctl_class = class_create(THIS_MODULE, "dspctl");
        devfs_mk_dir("dspctl");
        for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
-               class_simple_device_add(dsp_ctl_class,
-                                       MKDEV(OMAP_DSP_CTL_MAJOR,
-                                             dev_list[i].minor),
-                                       NULL, dev_list[i].devname);
+               class_device_create(dsp_ctl_class,
+                                   MKDEV(OMAP_DSP_CTL_MAJOR,
+                                         dev_list[i].minor),
+                                   NULL, dev_list[i].devname);
                devfs_mk_cdev(MKDEV(OMAP_DSP_CTL_MAJOR, dev_list[i].minor),
                              S_IFCHR | dev_list[i].mode,
                              dev_list[i].devfs_name);
@@ -119,11 +119,12 @@ void dsp_ctl_core_exit(void)
 
        for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
                devfs_remove(dev_list[i].devfs_name);
-               class_simple_device_remove(MKDEV(OMAP_DSP_CTL_MAJOR,
-                                                dev_list[i].minor));
+               class_device_destroy(dsp_ctl_class,
+                                    MKDEV(OMAP_DSP_CTL_MAJOR,
+                                          dev_list[i].minor));
        }
        devfs_remove("dspctl");
-       class_simple_destroy(dsp_ctl_class);
+       class_destroy(dsp_ctl_class);
 
        unregister_chrdev(OMAP_DSP_CTL_MAJOR, "dspctl");
 }
index 107417941c2cc976290f055cffb677c186b5294a..972e54c52cb775cd72cf79fb8a2d410c69d80303 100644 (file)
@@ -1340,7 +1340,8 @@ static int dsp_mem_release(struct inode *inode, struct file *file)
 /*
  * sysfs files
  */
-static ssize_t mmu_show(struct device *dev, char *buf)
+static ssize_t mmu_show(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
        int len;
        int lbase, victim;
@@ -1405,7 +1406,8 @@ static ssize_t mmu_show(struct device *dev, char *buf)
 
 static struct device_attribute dev_attr_mmu = __ATTR_RO(mmu);
 
-static ssize_t exmap_show(struct device *dev, char *buf)
+static ssize_t exmap_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        int len;
        int i;
index 9926dadc0b6b7349da8b206ddc21a1e1b4e3a241..305ce68917225f10f97c66d6de1322a43e2419bb 100644 (file)
@@ -234,7 +234,8 @@ void mbx1_err_ipbfull(void)
 /*
  * sysfs files
  */
-static ssize_t ipbuf_show(struct device *dev, char *buf)
+static ssize_t ipbuf_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        int len = 0;
        unsigned short bid;
index 3671c436c542dcb6d386b2303968f21d208d85bd..69d42c82f20d6204fd56dea829fbbf9fe18af42f 100644 (file)
@@ -165,7 +165,8 @@ void mblog_add(struct mbcmd *mb, enum mblog_dir dir)
 /*
  * sysfs file
  */
-static ssize_t mblog_show(struct device *dev, char *buf)
+static ssize_t mblog_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        int len = 0;
        int wp;
index 118f1a974cfd24438a245ce1247ebe9aaf7f42c3..fe028a09e8fcc87a3264c7db5be8eab0d7f73800 100644 (file)
@@ -148,17 +148,28 @@ static void taskdev_delete(unsigned char minor);
 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);
@@ -176,7 +187,7 @@ static struct bus_type dsptask_bus = {
        .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);
@@ -1681,9 +1692,8 @@ static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor)
        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);
 
@@ -1703,6 +1713,7 @@ static void taskdev_delete(unsigned char 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);
@@ -2416,7 +2427,8 @@ void mbx1_dbg(struct mbcmd *mb)
 /*
  * 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);
@@ -2433,13 +2445,15 @@ static ssize_t devname_show(struct device *d, char *buf)
        ((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;
@@ -2455,7 +2469,8 @@ static ssize_t proc_list_show(struct device *d, char *buf)
        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;
@@ -2465,7 +2480,8 @@ static ssize_t taskname_show(struct device *d, char *buf)
        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;
@@ -2487,13 +2503,15 @@ static ssize_t ttyp_show(struct device *d, char *buf)
        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;
@@ -2505,7 +2523,8 @@ static int fifosz_store(struct device *d, const char *buf, size_t count)
        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);
@@ -2526,7 +2545,8 @@ static __inline__ char *bid_name(unsigned short bid)
        }
 }
 
-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;
@@ -2539,12 +2559,14 @@ static ssize_t ipblink_show(struct device *d, char *buf)
        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);
@@ -2599,7 +2621,7 @@ int __init dsp_taskmod_init(void)
                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;
@@ -2608,7 +2630,7 @@ int __init dsp_taskmod_init(void)
 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");