Commit e8fe1ef1 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: fix CamelCase global variables in file.c

Fix CamelCase names:

Cdev => file_cdev
PControlVm_channel => file_controlvm_channel
MajorDev => majordev
Registered => registered
Signed-off-by: default avatarKen Depro <kenneth.depro@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73813128
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
#define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c #define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c
static struct cdev Cdev; static struct cdev file_cdev;
static VISORCHANNEL **PControlVm_channel; static VISORCHANNEL **file_controlvm_channel;
static dev_t MajorDev = -1; /**< indicates major num for device */ static dev_t majordev = -1; /**< indicates major num for device */
static BOOL Registered = FALSE; static BOOL registered = FALSE;
static int visorchipset_open(struct inode *inode, struct file *file); static int visorchipset_open(struct inode *inode, struct file *file);
static int visorchipset_release(struct inode *inode, struct file *file); static int visorchipset_release(struct inode *inode, struct file *file);
...@@ -61,50 +61,50 @@ int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel) ...@@ -61,50 +61,50 @@ int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel)
{ {
int rc = 0; int rc = 0;
PControlVm_channel = controlvm_channel; file_controlvm_channel = controlvm_channel;
MajorDev = major_dev; majordev = major_dev;
cdev_init(&Cdev, &visorchipset_fops); cdev_init(&file_cdev, &visorchipset_fops);
Cdev.owner = THIS_MODULE; file_cdev.owner = THIS_MODULE;
if (MAJOR(MajorDev) == 0) { if (MAJOR(majordev) == 0) {
/* dynamic major device number registration required */ /* dynamic major device number registration required */
if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) { if (alloc_chrdev_region(&majordev, 0, 1, MYDRVNAME) < 0) {
ERRDRV("Unable to allocate+register char device %s", ERRDRV("Unable to allocate+register char device %s",
MYDRVNAME); MYDRVNAME);
return -1; return -1;
} }
Registered = TRUE; registered = TRUE;
INFODRV("New major number %d registered\n", MAJOR(MajorDev)); INFODRV("New major number %d registered\n", MAJOR(majordev));
} else { } else {
/* static major device number registration required */ /* static major device number registration required */
if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) { if (register_chrdev_region(majordev, 1, MYDRVNAME) < 0) {
ERRDRV("Unable to register char device %s", MYDRVNAME); ERRDRV("Unable to register char device %s", MYDRVNAME);
return -1; return -1;
} }
Registered = TRUE; registered = TRUE;
INFODRV("Static major number %d registered\n", MAJOR(MajorDev)); INFODRV("Static major number %d registered\n", MAJOR(majordev));
} }
rc = cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1); rc = cdev_add(&file_cdev, MKDEV(MAJOR(majordev), 0), 1);
if (rc < 0) { if (rc < 0) {
ERRDRV("failed to create char device: (status=%d)\n", rc); ERRDRV("failed to create char device: (status=%d)\n", rc);
return -1; return -1;
} }
INFODRV("Registered char device for %s (major=%d)", INFODRV("Registered char device for %s (major=%d)",
MYDRVNAME, MAJOR(MajorDev)); MYDRVNAME, MAJOR(majordev));
return 0; return 0;
} }
void void
visorchipset_file_cleanup(void) visorchipset_file_cleanup(void)
{ {
if (Cdev.ops != NULL) if (file_cdev.ops != NULL)
cdev_del(&Cdev); cdev_del(&file_cdev);
Cdev.ops = NULL; file_cdev.ops = NULL;
if (Registered) { if (registered) {
if (MAJOR(MajorDev) >= 0) { if (MAJOR(majordev) >= 0) {
unregister_chrdev_region(MajorDev, 1); unregister_chrdev_region(majordev, 1);
MajorDev = MKDEV(0, 0); majordev = MKDEV(0, 0);
} }
Registered = FALSE; registered = FALSE;
} }
} }
...@@ -148,11 +148,11 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -148,11 +148,11 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma)
switch (offset) { switch (offset) {
case VISORCHIPSET_MMAP_CONTROLCHANOFFSET: case VISORCHIPSET_MMAP_CONTROLCHANOFFSET:
vma->vm_flags |= VM_IO; vma->vm_flags |= VM_IO;
if (*PControlVm_channel == NULL) { if (*file_controlvm_channel == NULL) {
ERRDRV("%s no controlvm channel yet", __func__); ERRDRV("%s no controlvm channel yet", __func__);
return -ENXIO; return -ENXIO;
} }
visorchannel_read(*PControlVm_channel, visorchannel_read(*file_controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol, offsetof(struct spar_controlvm_channel_protocol,
gp_control_channel), gp_control_channel),
&addr, sizeof(addr)); &addr, sizeof(addr));
......
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