Commit addceb12 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman

staging: unisys: use local variable in cleanup

the dev_t was being stored in visorchipset_platform_device.dev.devt
while initializing the module. so pass that value as an argument to
cleanup() so that it can use this local variable instead of the global
variable.
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a1191146
...@@ -73,13 +73,13 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel) ...@@ -73,13 +73,13 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel)
} }
void void
visorchipset_file_cleanup(void) visorchipset_file_cleanup(dev_t major_dev)
{ {
if (file_cdev.ops != NULL) if (file_cdev.ops != NULL)
cdev_del(&file_cdev); cdev_del(&file_cdev);
file_cdev.ops = NULL; file_cdev.ops = NULL;
if (MAJOR(majordev) >= 0) { if (MAJOR(major_dev) >= 0) {
unregister_chrdev_region(majordev, 1); unregister_chrdev_region(major_dev, 1);
majordev = MKDEV(0, 0); majordev = MKDEV(0, 0);
} }
} }
......
...@@ -22,6 +22,6 @@ ...@@ -22,6 +22,6 @@
int visorchipset_file_init(dev_t majorDev, int visorchipset_file_init(dev_t majorDev,
struct visorchannel **pControlVm_channel); struct visorchannel **pControlVm_channel);
void visorchipset_file_cleanup(void); void visorchipset_file_cleanup(dev_t major_dev);
#endif #endif
...@@ -2278,7 +2278,7 @@ visorchipset_exit(void) ...@@ -2278,7 +2278,7 @@ visorchipset_exit(void)
visorchannel_destroy(controlvm_channel); visorchannel_destroy(controlvm_channel);
visorchipset_file_cleanup(); visorchipset_file_cleanup(visorchipset_platform_device.dev.devt);
POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO); POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment