Magellan Linux

Annotation of /trunk/kernel26-magellan/patches-2.6.16-r10/0102-2.6.16.12-gpio.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 70 - (hide annotations) (download)
Thu May 11 19:09:22 2006 UTC (18 years ago) by niro
File size: 1485 byte(s)
import

1 niro 70 From: Thayumanavar Sachithanantham <thayumk@gmail.com>
2     Date: Thu, 20 Apr 2006 16:00:56 +0000 (+0000)
3     Subject: [PATCH] cs5535_gpio.c: call cdev_del() during module_exit to unmap kobject references ...
4     X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.16.y.git;a=commitdiff;h=f1e64a332ce7e00d5e5fa25e505e54dff3049ddc
5    
6     [PATCH] cs5535_gpio.c: call cdev_del() during module_exit to unmap kobject references and other cleanups
7    
8     During module unloading, cdev_del() must be called to unmap cdev related
9     kobject references and other cleanups(such as inode->i_cdev being set to
10     NULL) which prevents the OOPS upon subsequent loading, usage and unloading
11     of modules(as seen in the mail thread
12     http://marc.theaimsgroup.com/?l=linux-kernel&m=114533640609018&w=2).
13    
14     Also, remove unneeded test of gpio_base.
15    
16     Signed-off-by: Thayumanavar Sachithanantham <thayumk@gmail.com>
17     Signed-off-by: Andrew Morton <akpm@osdl.org>
18     Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19     Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20     ---
21    
22     --- a/drivers/char/cs5535_gpio.c
23     +++ b/drivers/char/cs5535_gpio.c
24     @@ -241,9 +241,10 @@ static int __init cs5535_gpio_init(void)
25     static void __exit cs5535_gpio_cleanup(void)
26     {
27     dev_t dev_id = MKDEV(major, 0);
28     +
29     + cdev_del(&cs5535_gpio_cdev);
30     unregister_chrdev_region(dev_id, CS5535_GPIO_COUNT);
31     - if (gpio_base != 0)
32     - release_region(gpio_base, CS5535_GPIO_SIZE);
33     + release_region(gpio_base, CS5535_GPIO_SIZE);
34     }
35    
36     module_init(cs5535_gpio_init);