Commit 2ea6f685 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds

[PATCH] make cdev_get static, unexport

- 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: default avatarArjan van de Ven <arjan@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 35752097
......@@ -249,6 +249,28 @@ int unregister_chrdev(unsigned int major, const char *name)
}
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);
......
......@@ -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 *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment