Skip to content

Commit

Permalink
staging: unisys: use local variable in cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sudip Mukherjee authored and Greg Kroah-Hartman committed Mar 26, 2015
1 parent a119114 commit addceb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/unisys/visorchipset/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/unisys/visorchipset/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion drivers/staging/unisys/visorchipset/visorchipset_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit addceb1

Please sign in to comment.