]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: convert dsp driver to use struct device
authorTrilok Soni <soni.trilok@gmail.com>
Fri, 2 Mar 2007 11:56:10 +0000 (03:56 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 2 Mar 2007 11:56:10 +0000 (03:56 -0800)
Converts from using "class_device" to "struct device".

Signed-off-by: Trilok Soni <soni.trilok@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dsp/dsp_ctl_core.c
arch/arm/plat-omap/dsp/task.c
arch/arm/plat-omap/mailbox.c
include/asm-arm/arch-omap/mailbox.h

index 04420df04769021eebb518c5e615ee1cc2e6ff77..d17a5c86f6abbfde7611bb27e058c2c568bba7e2 100644 (file)
@@ -107,10 +107,10 @@ int __init dsp_ctl_core_init(void)
 
        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;
@@ -121,9 +121,9 @@ void dsp_ctl_core_exit(void)
        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);
 
index 807c40835dc2f0ab801ae05fcdd66e3ac9f4daa0..10eee909805bc29241d01062971a63fc748530a9 100644 (file)
@@ -1821,9 +1821,9 @@ static int taskdev_init(struct taskdev *dev, char *name, unsigned char minor)
        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);
@@ -1840,7 +1840,7 @@ static void taskdev_delete(unsigned char minor)
        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;
index ab71d53d0bd3ff5a76d2fce4e5b80cba37871683..c194c328bdd6c5c549b9725cfa45764a1d9dedec 100644 (file)
@@ -178,12 +178,13 @@ static irqreturn_t mbox_interrupt(int irq, void *p)
 /*
  * 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);
 
@@ -194,14 +195,15 @@ static ssize_t mbox_attr_write(struct class_device *dev, const char *buf,
        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)
 {
@@ -224,18 +226,18 @@ static int omap_mbox_init(struct omap_mbox *mbox)
                        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;
        }
 
index 66669f07b95b65b3915f8625c8243522c676136b..87395ea58b2d5db22bbfd6fe6183b7e8fd8e0b12 100644 (file)
@@ -51,7 +51,7 @@ struct omap_mbox {
 
        mbox_msg_t seq_snd, seq_rcv;
 
-       struct class_device class_dev;
+       struct device dev;
 
        void *priv;