Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1efa770f8ef0bfe12cd004f2e1f75eefcd8699d3
Commit:     1efa770f8ef0bfe12cd004f2e1f75eefcd8699d3
Parent:     82dd9eff4bf3b17f5f511ae931a1f350c36ca9eb
Author:     Dmitry Torokhov <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 18 01:40:37 2007 -0500
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Sun Feb 18 01:40:37 2007 -0500

    Input: do not lock device when showing name, phys and uniq
    
    Now that sysfs attributes return -ENODEV once driver requests their
    removal we do not need to handle scenario when data is deleted from
    under our feet and can simplify the code.
    
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/input.c |   17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index efa1b1f..a9a706f 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -588,18 +588,9 @@ static inline void input_proc_exit(void) { }
 static ssize_t input_dev_show_##name(struct class_device *dev, char *buf)      
\
 {                                                                              
\
        struct input_dev *input_dev = to_input_dev(dev);                        
\
-       int retval;                                                             
\
                                                                                
\
-       retval = mutex_lock_interruptible(&input_dev->mutex);                   
\
-       if (retval)                                                             
\
-               return retval;                                                  
\
-                                                                               
\
-       retval = scnprintf(buf, PAGE_SIZE,                                      
\
-                          "%s\n", input_dev->name ? input_dev->name : "");     
\
-                                                                               
\
-       mutex_unlock(&input_dev->mutex);                                        
\
-                                                                               
\
-       return retval;                                                          
\
+       return scnprintf(buf, PAGE_SIZE, "%s\n",                                
\
+                        input_dev->name ? input_dev->name : "");               
\
 }                                                                              
\
 static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL);
 
@@ -1049,10 +1040,6 @@ void input_unregister_device(struct input_dev *dev)
        sysfs_remove_group(&dev->cdev.kobj, &input_dev_id_attr_group);
        sysfs_remove_group(&dev->cdev.kobj, &input_dev_attr_group);
 
-       mutex_lock(&dev->mutex);
-       dev->name = dev->phys = dev->uniq = NULL;
-       mutex_unlock(&dev->mutex);
-
        class_device_unregister(&dev->cdev);
 
        input_wakeup_procfs_readers();
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to