lkml.org 
[lkml]   [2006]   [Nov]   [8]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    DateWed, 8 Nov 2006 21:40:10 +0900
    FromAkinobu Mita <>
    Subject[PATCH 3/4] input: check whether serio dirver registration is completed
    This patch adds a flag to serio driver indicating whether registration is
    complete and check that flag in serio_unregister_driver.
    
    Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
    
     drivers/input/serio/serio.c |    7 ++++++-
     include/linux/serio.h       |    1 +
     2 files changed, 7 insertions(+), 1 deletion(-)
    Index: work-fault-inject/include/linux/serio.h
    ===================================================================
    --- work-fault-inject.orig/include/linux/serio.h
    +++ work-fault-inject/include/linux/serio.h
    @@ -68,6 +68,7 @@ struct serio_driver {
     	void (*cleanup)(struct serio *);
     
     	struct device_driver driver;
    +	int registered;
     };
     #define to_serio_driver(d)	container_of(d, struct serio_driver, driver)
     
    Index: work-fault-inject/drivers/input/serio/serio.c
    ===================================================================
    --- work-fault-inject.orig/drivers/input/serio/serio.c
    +++ work-fault-inject/drivers/input/serio/serio.c
    @@ -804,6 +804,8 @@ static void serio_add_driver(struct seri
     		printk(KERN_ERR
     			"serio: driver_register() failed for %s, error: %d\n",
     			drv->driver.name, error);
    +	else
    +		drv->registered = 1;
     }
     
     int __serio_register_driver(struct serio_driver *drv, struct module *owner)
    @@ -830,7 +832,10 @@ start_over:
     		}
     	}
     
    -	driver_unregister(&drv->driver);
    +	if (drv->registered) {
    +		driver_unregister(&drv->driver);
    +		drv->registered = 0;
    +	}
     	mutex_unlock(&serio_mutex);
     }
     
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    
    \
     
     \ /
      Last update: 2006-11-08 12:43    [from the cache]
    ©2003-2008