All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: convert dsp driver to use struct device
@ 2007-02-17 11:01 Trilok Soni
  2007-02-25  7:21 ` Trilok Soni
  0 siblings, 1 reply; 3+ messages in thread
From: Trilok Soni @ 2007-02-17 11:01 UTC (permalink / raw)
  To: linux-omap-open-source; +Cc: Hiroshi.DOYU

[-- Attachment #1: Type: text/plain, Size: 18 bytes --]

-- 
--Trilok Soni

[-- Attachment #2: 0001-ARM-OMAP-convert-dsp-driver-to-use-struct-device.txt --]
[-- Type: text/plain, Size: 5172 bytes --]

From nobody Mon Sep 17 00:00:00 2001
From: Trilok Soni <soni.trilok@gmail.com>
Date: Sat, 17 Feb 2007 21:58:09 +0530
Subject: [PATCH] ARM: OMAP: convert dsp driver to use struct device

Converts from using "class_device" to "struct device".

Signed-off-by: Trilok Soni <soni.trilok@gmail.com>

---

 arch/arm/plat-omap/dsp/dsp_ctl_core.c |   10 +++++-----
 arch/arm/plat-omap/dsp/task.c         |    8 ++++----
 arch/arm/plat-omap/mailbox.c          |   26 ++++++++++++++------------
 include/asm-arm/arch-omap/mailbox.h   |    2 +-
 4 files changed, 24 insertions(+), 22 deletions(-)

caeda7187f86a927b3835d820e2879f3a54fdb3f
diff --git a/arch/arm/plat-omap/dsp/dsp_ctl_core.c b/arch/arm/plat-omap/dsp/dsp_ctl_core.c
index 04420df..d17a5c8 100644
--- a/arch/arm/plat-omap/dsp/dsp_ctl_core.c
+++ b/arch/arm/plat-omap/dsp/dsp_ctl_core.c
@@ -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);
 
diff --git a/arch/arm/plat-omap/dsp/task.c b/arch/arm/plat-omap/dsp/task.c
index 807c408..10eee90 100644
--- a/arch/arm/plat-omap/dsp/task.c
+++ b/arch/arm/plat-omap/dsp/task.c
@@ -1821,9 +1821,9 @@ static int taskdev_init(struct taskdev *
 	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
 	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;
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 26ace23..4e6df33 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -178,12 +178,13 @@ static irqreturn_t mbox_interrupt(int ir
 /*
  * 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 cl
 	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_mb
 			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;
 	}
 
diff --git a/include/asm-arm/arch-omap/mailbox.h b/include/asm-arm/arch-omap/mailbox.h
index 66669f0..87395ea 100644
--- a/include/asm-arm/arch-omap/mailbox.h
+++ b/include/asm-arm/arch-omap/mailbox.h
@@ -51,7 +51,7 @@ struct omap_mbox {
 
 	mbox_msg_t seq_snd, seq_rcv;
 
-	struct class_device class_dev;
+	struct device dev;
 
 	void *priv;
 
-- 
1.3.3


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: OMAP: convert dsp driver to use struct device
  2007-02-17 11:01 [PATCH] ARM: OMAP: convert dsp driver to use struct device Trilok Soni
@ 2007-02-25  7:21 ` Trilok Soni
  2007-03-02 11:56   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Trilok Soni @ 2007-02-25  7:21 UTC (permalink / raw)
  To: linux-omap-open-source; +Cc: Hiroshi.DOYU

Tony,

Please push this patch if there are no comments.

-- 
--Trilok Soni

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: OMAP: convert dsp driver to use struct device
  2007-02-25  7:21 ` Trilok Soni
@ 2007-03-02 11:56   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2007-03-02 11:56 UTC (permalink / raw)
  To: Trilok Soni; +Cc: Hiroshi.DOYU, linux-omap-open-source

* Trilok Soni <soni.trilok@gmail.com> [070224 23:23]:
> Tony,
> 
> Please push this patch if there are no comments.

Pushing today.

Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-02 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-17 11:01 [PATCH] ARM: OMAP: convert dsp driver to use struct device Trilok Soni
2007-02-25  7:21 ` Trilok Soni
2007-03-02 11:56   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.