There are some problems which we faced in un- registering the driver
1. there is no return type of unregister_chrdev_region , so you can check the result only by using vim /proc/devices after rmmod command
2. suppose if you are registering 10 devices using alloc_chrdev_region then you have to give 10 on the second argument of unregister_chrdev_region function, else it will not remove the driver entry from the driver table.
RCS file: clean.c,v
Working file: clean.c
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
included the unregister_chrdev_region to unregister the device
to do so we need the major minor number.
which we’ll get from the first argv of alloc_chrdev_region
as i am using seperate files so , i have to use this dev_t dev as a extern in exit function
—————————-
revision 1.4
date: 2014/02/13 10:19:28; author: raghav; state: Exp; lines: +1 -1
Error detected: In the second argument of unregister_chrdev_region func() we have to input only that number of drivers which we have registered.
suppose if we have register our driver for 10 devices then in the unregister fun() we have to unregister 10 devices i.e give 10 in the second argument of unregister function.
—————————-
revision 1.3
date: 2014/02/13 10:18:05; author: raghav; state: Exp; lines: +6 -5
Error in un registering the driver from the driver table
—————————-
revision 1.2
date: 2014/02/13 06:09:06; author: raghav; state: Exp; lines: +3 -5
included the unregister_chrdev_region to unregister the driver, but here its return type is void
—————————-
revision 1.1
date: 2014/02/13 05:58:43; author: raghav; state: Exp;
Initial revision
=============================================================================