
From: Arjan van de Ven <arjan@infradead.org>

- cdev_get is only used in fs/char_dev.c; move it up, make it static and
  unexport it.

- cdev_put is used in one more place (fs/file_table.c) but never in
  modules; unexport it.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/char_dev.c        |   44 +++++++++++++++++++++----------------------
 25-akpm/include/linux/cdev.h |    2 -
 2 files changed, 22 insertions(+), 24 deletions(-)

diff -puN fs/char_dev.c~make-cdev_get-static-unexport fs/char_dev.c
--- 25/fs/char_dev.c~make-cdev_get-static-unexport	Mon Nov  8 15:14:06 2004
+++ 25-akpm/fs/char_dev.c	Mon Nov  8 15:14:06 2004
@@ -249,6 +249,28 @@ int unregister_chrdev(unsigned int major
 }
 
 static spinlock_t cdev_lock = SPIN_LOCK_UNLOCKED;
+
+static struct kobject *cdev_get(struct cdev *p)
+{
+	struct module *owner = p->owner;
+	struct kobject *kobj;
+
+	if (owner && !try_module_get(owner))
+		return NULL;
+	kobj = kobject_get(&p->kobj);
+	if (!kobj)
+		module_put(owner);
+	return kobj;
+}
+
+void cdev_put(struct cdev *p)
+{
+	if (p) {
+		kobject_put(&p->kobj);
+		module_put(p->owner);
+	}
+}
+
 /*
  * Called every time a character special file is opened
  */
@@ -357,26 +379,6 @@ void cdev_del(struct cdev *p)
 	kobject_put(&p->kobj);
 }
 
-struct kobject *cdev_get(struct cdev *p)
-{
-	struct module *owner = p->owner;
-	struct kobject *kobj;
-
-	if (owner && !try_module_get(owner))
-		return NULL;
-	kobj = kobject_get(&p->kobj);
-	if (!kobj)
-		module_put(owner);
-	return kobj;
-}
-
-void cdev_put(struct cdev *p)
-{
-	if (p) {
-		kobject_put(&p->kobj);
-		module_put(p->owner);
-	}
-}
 
 static decl_subsys(cdev, NULL, NULL);
 
@@ -447,8 +449,6 @@ EXPORT_SYMBOL(unregister_chrdev_region);
 EXPORT_SYMBOL(alloc_chrdev_region);
 EXPORT_SYMBOL(cdev_init);
 EXPORT_SYMBOL(cdev_alloc);
-EXPORT_SYMBOL(cdev_get);
-EXPORT_SYMBOL(cdev_put);
 EXPORT_SYMBOL(cdev_del);
 EXPORT_SYMBOL(cdev_add);
 EXPORT_SYMBOL(register_chrdev);
diff -puN include/linux/cdev.h~make-cdev_get-static-unexport include/linux/cdev.h
--- 25/include/linux/cdev.h~make-cdev_get-static-unexport	Mon Nov  8 15:14:06 2004
+++ 25-akpm/include/linux/cdev.h	Mon Nov  8 15:14:06 2004
@@ -17,8 +17,6 @@ struct cdev *cdev_alloc(void);
 
 void cdev_put(struct cdev *p);
 
-struct kobject *cdev_get(struct cdev *);
-
 int cdev_add(struct cdev *, dev_t, unsigned);
 
 void cdev_del(struct cdev *);
_
