All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Paul Mundt <lethal@linux-sh.org>,
	Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
	Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
Cc: linux-omap@vger.kernel.org, linux-omap-open-source@linux.omap.com
Subject: [PATCH 2/3] ARM: OMAP: Change MMU to use sysdev_class?
Date: Mon, 3 Dec 2007 14:40:29 -0800	[thread overview]
Message-ID: <20071203224029.GF4105@atomide.com> (raw)
In-Reply-To: <20071203222651.GE4105@atomide.com>

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

We could optionally change to use sysdev_class. But that changes the
sysfs path to /sys/devices/system/mmu/mempool.

What do you guys think? Should we change it, or keep using class device?

Regards,

Tony

[-- Attachment #2: mmu-sysdev.patch --]
[-- Type: text/x-diff, Size: 2504 bytes --]

>From 0ca34f3a9f9e6859e8fbe6d206188b33f1f49c2a Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 3 Dec 2007 14:33:39 -0800
Subject: [PATCH] ARM: OMAP: Change MMU to use sysdev_class

ARM: OMAP: Change MMU to use sysdev_class.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/plat-omap/mmu.c b/arch/arm/plat-omap/mmu.c
index b7ae3d2..9f05d5a 100644
--- a/arch/arm/plat-omap/mmu.c
+++ b/arch/arm/plat-omap/mmu.c
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/sysdev.h>
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <asm/uaccess.h>
@@ -1429,7 +1430,7 @@ static ssize_t exmap_store(struct device *dev, struct device_attribute *attr,
 
 static DEVICE_ATTR(exmap, S_IRUGO | S_IWUSR, exmap_show, exmap_store);
 
-static ssize_t mempool_show(struct class *class, char *buf)
+static ssize_t mempool_show(struct sysdev_class *class, char *buf)
 {
 	int min_nr_1M = 0, curr_nr_1M = 0;
 	int min_nr_64K = 0, curr_nr_64K = 0;
@@ -1454,17 +1455,16 @@ static ssize_t mempool_show(struct class *class, char *buf)
 }
 
 
-static CLASS_ATTR(mempool, S_IRUGO, mempool_show, NULL);
+static SYSDEV_CLASS_ATTR(mempool, S_IRUGO, mempool_show, NULL);
 
-static struct class omap_mmu_class = {
-	.name		= "mmu",
+static struct sysdev_class omap_mmu = {
+	set_kset_name("mmu"),
 };
 
 int omap_mmu_register(struct omap_mmu *mmu)
 {
 	int ret;
 
-	mmu->dev.class = &omap_mmu_class;
 	strlcpy(mmu->dev.bus_id, mmu->name, KOBJ_NAME_LEN);
 	dev_set_drvdata(&mmu->dev, mmu);
 
@@ -1548,22 +1548,22 @@ void omap_mmu_unregister(struct omap_mmu *mmu)
 }
 EXPORT_SYMBOL_GPL(omap_mmu_unregister);
 
-static int __init omap_mmu_class_init(void)
+static int __init omap_mmu_sysdev_init(void)
 {
-	int ret = class_register(&omap_mmu_class);
+	int ret = sysdev_class_register(&omap_mmu);
 	if (!ret)
-		ret = class_create_file(&omap_mmu_class, &class_attr_mempool);
+		ret = sysdev_class_create_file(&omap_mmu, &attr_mempool);
 
 	return ret;
 }
 
-static void __exit omap_mmu_class_exit(void)
+static void __exit omap_mmu_sysdev_exit(void)
 {
-	class_remove_file(&omap_mmu_class, &class_attr_mempool);
-	class_unregister(&omap_mmu_class);
+	sysdev_class_remove_file(&omap_mmu, &attr_mempool);
+	sysdev_class_unregister(&omap_mmu);
 }
 
-subsys_initcall(omap_mmu_class_init);
-module_exit(omap_mmu_class_exit);
+subsys_initcall(omap_mmu_sysdev_init);
+module_exit(omap_mmu_sysdev_exit);
 
 MODULE_LICENSE("GPL");

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



  reply	other threads:[~2007-12-03 22:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 22:26 [PATCH 1/3] ARM: OMAP: User GPLv2 for MMU, make checkpatch.pl happier Tony Lindgren
2007-12-03 22:40 ` Tony Lindgren [this message]
2007-12-03 22:46   ` [PATCH 3/3] ARM: OMAP: Add MMU framework Tony Lindgren
2007-12-03 22:59     ` Paul Mundt
2007-12-03 22:50   ` [PATCH 2/3] ARM: OMAP: Change MMU to use sysdev_class? David Brownell
2007-12-03 22:56     ` Tony Lindgren
2007-12-03 22:57     ` Paul Mundt
2007-12-03 23:03       ` Tony Lindgren
2007-12-04  6:34 ` [PATCH 1/3] ARM: OMAP: User GPLv2 for MMU, make checkpatch.pl happier Trilok Soni
2007-12-04  8:24   ` Paul Mundt
2007-12-04  8:42     ` Trilok Soni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071203224029.GF4105@atomide.com \
    --to=tony@atomide.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-omap-open-source@linux.omap.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=toshihiro.kobayashi@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.