Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317575
b: refs/heads/master
c: ba0a7ae
h: refs/heads/master
i:
  317573: 94d7dba
  317571: c129d0b
  317567: f713a5a
v: v3
  • Loading branch information
Rupesh Gujare authored and Greg Kroah-Hartman committed Jun 26, 2012
1 parent 4fb59f4 commit 2191522
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: f204739736fecee77280c7743b5409dd158a49a6
refs/heads/master: ba0a7ae713c89c7be204646d9a34c7f612743f51
12 changes: 8 additions & 4 deletions trunk/drivers/staging/ozwpan/ozcdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct oz_serial_ctx {
/*------------------------------------------------------------------------------
*/
static struct oz_cdev g_cdev;
struct class *g_oz_class;
/*------------------------------------------------------------------------------
* Context: process and softirq
*/
Expand Down Expand Up @@ -330,7 +331,6 @@ const struct file_operations oz_fops = {
int oz_cdev_register(void)
{
int err;
struct class *cl;
struct device *dev;
memset(&g_cdev, 0, sizeof(g_cdev));
err = alloc_chrdev_region(&g_cdev.devnum, 0, 1, "ozwpan");
Expand All @@ -348,12 +348,12 @@ int oz_cdev_register(void)
oz_trace("Failed to add cdev\n");
goto out2;
}
cl = class_create(THIS_MODULE, "ozmo_wpan");
if (IS_ERR(cl)) {
g_oz_class = class_create(THIS_MODULE, "ozmo_wpan");
if (IS_ERR(g_oz_class)) {
oz_trace("Failed to register ozmo_wpan class\n");
goto out1;
}
dev = device_create(cl, NULL, g_cdev.devnum, NULL, "ozwpan");
dev = device_create(g_oz_class, NULL, g_cdev.devnum, NULL, "ozwpan");
if (IS_ERR(dev)) {
oz_trace("Failed to create sysfs entry for cdev\n");
goto out1;
Expand All @@ -373,6 +373,10 @@ int oz_cdev_deregister(void)
{
cdev_del(&g_cdev.cdev);
unregister_chrdev_region(g_cdev.devnum, 1);
if (g_oz_class) {
device_destroy(g_oz_class, g_cdev.devnum);
class_destroy(g_oz_class);
}
return 0;
}
/*------------------------------------------------------------------------------
Expand Down

0 comments on commit 2191522

Please sign in to comment.