Commit 78acd587 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Greg Kroah-Hartman

Staging: bcm: Bcmchar: Fix some checkpatch errors

Signed-off-by: default avatarJavier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7227ba06
...@@ -2100,7 +2100,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -2100,7 +2100,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
static struct file_operations bcm_fops = { static const struct file_operations bcm_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = bcm_char_open, .open = bcm_char_open,
.release = bcm_char_release, .release = bcm_char_release,
...@@ -2114,20 +2114,20 @@ extern struct class *bcm_class; ...@@ -2114,20 +2114,20 @@ extern struct class *bcm_class;
int register_control_device_interface(PMINI_ADAPTER Adapter) int register_control_device_interface(PMINI_ADAPTER Adapter)
{ {
if(Adapter->major>0) if (Adapter->major > 0)
return Adapter->major; return Adapter->major;
Adapter->major = register_chrdev(0, DEV_NAME, &bcm_fops); Adapter->major = register_chrdev(0, DEV_NAME, &bcm_fops);
if(Adapter->major < 0) { if (Adapter->major < 0) {
pr_err(DRV_NAME ": could not created character device\n"); pr_err(DRV_NAME ": could not created character device\n");
return Adapter->major; return Adapter->major;
} }
Adapter->pstCreatedClassDevice = device_create (bcm_class, NULL, Adapter->pstCreatedClassDevice = device_create(bcm_class, NULL,
MKDEV(Adapter->major, 0), Adapter, MKDEV(Adapter->major, 0),
DEV_NAME); Adapter, DEV_NAME);
if(IS_ERR(Adapter->pstCreatedClassDevice)) { if (IS_ERR(Adapter->pstCreatedClassDevice)) {
pr_err(DRV_NAME ": class device create failed\n"); pr_err(DRV_NAME ": class device create failed\n");
unregister_chrdev(Adapter->major, DEV_NAME); unregister_chrdev(Adapter->major, DEV_NAME);
return PTR_ERR(Adapter->pstCreatedClassDevice); return PTR_ERR(Adapter->pstCreatedClassDevice);
...@@ -2138,8 +2138,8 @@ int register_control_device_interface(PMINI_ADAPTER Adapter) ...@@ -2138,8 +2138,8 @@ int register_control_device_interface(PMINI_ADAPTER Adapter)
void unregister_control_device_interface(PMINI_ADAPTER Adapter) void unregister_control_device_interface(PMINI_ADAPTER Adapter)
{ {
if(Adapter->major > 0) { if (Adapter->major > 0) {
device_destroy (bcm_class, MKDEV(Adapter->major, 0)); device_destroy(bcm_class, MKDEV(Adapter->major, 0));
unregister_chrdev(Adapter->major, DEV_NAME); unregister_chrdev(Adapter->major, DEV_NAME);
} }
} }
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