diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-03-24 20:47:26 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-27 00:01:23 +0100 |
commit | 61986f730eb83912ac4a0c59b671232bdee07c40 (patch) | |
tree | e8d4853900d34722132447296c9a6598501d793b /drivers/staging/unisys/visorchipset/file.c | |
parent | staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macros (diff) | |
download | linux-dev-61986f730eb83912ac4a0c59b671232bdee07c40.tar.xz linux-dev-61986f730eb83912ac4a0c59b671232bdee07c40.zip |
staging: unisys: remove redundant variable
remove the variable "registered", which was used in the cleanup() to
detect if the driver has successfully initialized. the cleanup()
is called from module_exit, so its obvious that the module has
successfully initialized. if the initialization had failed, then
we will never be in the cleanup().
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorchipset/file.c')
-rw-r--r-- | drivers/staging/unisys/visorchipset/file.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index 9ca7f1eb1e7e..b426762665be 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -31,7 +31,6 @@ static struct cdev file_cdev; static struct visorchannel **file_controlvm_channel; static dev_t majordev = -1; /**< indicates major num for device */ -static BOOL registered = FALSE; static int visorchipset_open(struct inode *inode, struct file *file); static int visorchipset_release(struct inode *inode, struct file *file); @@ -62,12 +61,10 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel) /* dynamic major device number registration required */ if (alloc_chrdev_region(&majordev, 0, 1, MYDRVNAME) < 0) return -1; - registered = TRUE; } else { /* static major device number registration required */ if (register_chrdev_region(majordev, 1, MYDRVNAME) < 0) return -1; - registered = TRUE; } rc = cdev_add(&file_cdev, MKDEV(MAJOR(majordev), 0), 1); if (rc < 0) @@ -81,12 +78,9 @@ visorchipset_file_cleanup(void) if (file_cdev.ops != NULL) cdev_del(&file_cdev); file_cdev.ops = NULL; - if (registered) { - if (MAJOR(majordev) >= 0) { - unregister_chrdev_region(majordev, 1); - majordev = MKDEV(0, 0); - } - registered = FALSE; + if (MAJOR(majordev) >= 0) { + unregister_chrdev_region(majordev, 1); + majordev = MKDEV(0, 0); } } |