diff options
author | Sudip Mukherjee <[email protected]> | 2015-03-24 20:47:28 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2015-03-27 00:01:23 +0100 |
commit | addceb12a3ed62e50c842f4c8f6099e1ead29ba8 (patch) | |
tree | c4354e5b1df0abc7607928e53bff35eb3c833689 | |
parent | a1191146c9a6ebc0e15ef50788bd392339510c0d (diff) |
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: Sudip Mukherjee <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Benjamin Romer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/staging/unisys/visorchipset/file.c | 6 | ||||
-rw-r--r-- | drivers/staging/unisys/visorchipset/file.h | 2 | ||||
-rw-r--r-- | drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index 6ebe7f733ba4..257cfdd841d4 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -73,13 +73,13 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel) } void -visorchipset_file_cleanup(void) +visorchipset_file_cleanup(dev_t major_dev) { if (file_cdev.ops != NULL) cdev_del(&file_cdev); file_cdev.ops = NULL; - if (MAJOR(majordev) >= 0) { - unregister_chrdev_region(majordev, 1); + if (MAJOR(major_dev) >= 0) { + unregister_chrdev_region(major_dev, 1); majordev = MKDEV(0, 0); } } diff --git a/drivers/staging/unisys/visorchipset/file.h b/drivers/staging/unisys/visorchipset/file.h index dc7a19556b3f..51f7699b744b 100644 --- a/drivers/staging/unisys/visorchipset/file.h +++ b/drivers/staging/unisys/visorchipset/file.h @@ -22,6 +22,6 @@ int visorchipset_file_init(dev_t majorDev, struct visorchannel **pControlVm_channel); -void visorchipset_file_cleanup(void); +void visorchipset_file_cleanup(dev_t major_dev); #endif diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index 9c8605dea475..f2663d2c7530 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -2278,7 +2278,7 @@ visorchipset_exit(void) visorchannel_destroy(controlvm_channel); - visorchipset_file_cleanup(); + visorchipset_file_cleanup(visorchipset_platform_device.dev.devt); POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO); } |