summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-03-24 20:47:28 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-27 00:01:23 +0100
commitaddceb12a3ed62e50c842f4c8f6099e1ead29ba8 (patch)
treec4354e5b1df0abc7607928e53bff35eb3c833689 /drivers/staging/unisys
parenta1191146c9a6ebc0e15ef50788bd392339510c0d (diff)
downloadop-kernel-dev-addceb12a3ed62e50c842f4c8f6099e1ead29ba8.zip
op-kernel-dev-addceb12a3ed62e50c842f4c8f6099e1ead29ba8.tar.gz
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 <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')
-rw-r--r--drivers/staging/unisys/visorchipset/file.c6
-rw-r--r--drivers/staging/unisys/visorchipset/file.h2
-rw-r--r--drivers/staging/unisys/visorchipset/visorchipset_main.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c
index 6ebe7f7..257cfdd 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 dc7a195..51f7699 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 9c8605d..f2663d2c 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);
}
OpenPOWER on IntegriCloud