]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/char_dev.c
[PATCH] v4l: Documentation
[linux-2.6-omap-h63xx.git] / fs / char_dev.c
index e82aac9cc2f5b9d39101e372cdab81dd971725a0..3b1b1eefdbb01686f127df582143f922bf87c193 100644 (file)
@@ -150,7 +150,7 @@ __unregister_chrdev_region(unsigned major, unsigned baseminor, int minorct)
        struct char_device_struct *cd = NULL, **cp;
        int i = major_to_index(major);
 
-       up(&chrdevs_lock);
+       down(&chrdevs_lock);
        for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next)
                if ((*cp)->major == major &&
                    (*cp)->baseminor == baseminor &&
@@ -277,8 +277,9 @@ static struct kobject *cdev_get(struct cdev *p)
 void cdev_put(struct cdev *p)
 {
        if (p) {
+               struct module *owner = p->owner;
                kobject_put(&p->kobj);
-               module_put(p->owner);
+               module_put(owner);
        }
 }