Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236034
b: refs/heads/master
c: 78acd58
h: refs/heads/master
v: v3
  • Loading branch information
Javier Martinez Canillas authored and Greg Kroah-Hartman committed Feb 18, 2011
1 parent 83a2cbe commit 5ef3ee3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7227ba06479f981f5cf9977a7eeb3a20d30dc501
refs/heads/master: 78acd58746b513c062b3dafd5b563401bc9e9d47
20 changes: 10 additions & 10 deletions trunk/drivers/staging/bcm/Bcmchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
.open = bcm_char_open,
.release = bcm_char_release,
Expand All @@ -2114,32 +2114,32 @@ extern struct class *bcm_class;
int register_control_device_interface(PMINI_ADAPTER Adapter)
{

if(Adapter->major>0)
if (Adapter->major > 0)
return Adapter->major;

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");
return Adapter->major;
}

Adapter->pstCreatedClassDevice = device_create (bcm_class, NULL,
MKDEV(Adapter->major, 0), Adapter,
DEV_NAME);
Adapter->pstCreatedClassDevice = device_create(bcm_class, NULL,
MKDEV(Adapter->major, 0),
Adapter, DEV_NAME);

if(IS_ERR(Adapter->pstCreatedClassDevice)) {
if (IS_ERR(Adapter->pstCreatedClassDevice)) {
pr_err(DRV_NAME ": class device create failed\n");
unregister_chrdev(Adapter->major, DEV_NAME);
return PTR_ERR(Adapter->pstCreatedClassDevice);
}

return 0;
}

void unregister_control_device_interface(PMINI_ADAPTER Adapter)
{
if(Adapter->major > 0) {
device_destroy (bcm_class, MKDEV(Adapter->major, 0));
if (Adapter->major > 0) {
device_destroy(bcm_class, MKDEV(Adapter->major, 0));
unregister_chrdev(Adapter->major, DEV_NAME);
}
}

0 comments on commit 5ef3ee3

Please sign in to comment.