Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151256
b: refs/heads/master
c: d405640
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 3b4d334 commit 803d5b6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 4 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: 6fcf53acccf85b4b0d0260e66c692a341760f464
refs/heads/master: d405640539555b601e52f7d18f1f0b1345d18bf5
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/microcode_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ static const struct file_operations microcode_fops = {
static struct miscdevice microcode_dev = {
.minor = MICROCODE_MINOR,
.name = "microcode",
.devnode = "cpu/microcode",
.fops = &microcode_fops,
};

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/char/hw_random/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ static const struct file_operations rng_chrdev_ops = {
static struct miscdevice rng_miscdev = {
.minor = RNG_MISCDEV_MINOR,
.name = RNG_MODULE_NAME,
.devnode = "hwrng",
.fops = &rng_chrdev_ops,
};

Expand Down
15 changes: 12 additions & 3 deletions trunk/drivers/char/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ static const struct file_operations misc_fops = {
.open = misc_open,
};


/**
* misc_register - register a miscellaneous device
* @misc: device structure
Expand Down Expand Up @@ -217,8 +216,8 @@ int misc_register(struct miscdevice * misc)
misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
dev = MKDEV(MISC_MAJOR, misc->minor);

misc->this_device = device_create(misc_class, misc->parent, dev, NULL,
"%s", misc->name);
misc->this_device = device_create(misc_class, misc->parent, dev,
misc, "%s", misc->name);
if (IS_ERR(misc->this_device)) {
err = PTR_ERR(misc->this_device);
goto out;
Expand Down Expand Up @@ -264,6 +263,15 @@ int misc_deregister(struct miscdevice *misc)
EXPORT_SYMBOL(misc_register);
EXPORT_SYMBOL(misc_deregister);

static char *misc_nodename(struct device *dev)
{
struct miscdevice *c = dev_get_drvdata(dev);

if (c->devnode)
return kstrdup(c->devnode, GFP_KERNEL);
return NULL;
}

static int __init misc_init(void)
{
int err;
Expand All @@ -279,6 +287,7 @@ static int __init misc_init(void)
err = -EIO;
if (register_chrdev(MISC_MAJOR,"misc",&misc_fops))
goto fail_printk;
misc_class->nodename = misc_nodename;
return 0;

fail_printk:
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ static const struct file_operations _ctl_fops = {
static struct miscdevice _dm_misc = {
.minor = MISC_DYNAMIC_MINOR,
.name = DM_NAME,
.devnode = "mapper/control",
.fops = &_ctl_fops
};

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ static const struct file_operations tun_fops = {
static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
.name = "tun",
.devnode = "net/tun",
.fops = &tun_fops,
};

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/miscdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct miscdevice {
struct list_head list;
struct device *parent;
struct device *this_device;
const char *devnode;
};

extern int misc_register(struct miscdevice * misc);
Expand Down

0 comments on commit 803d5b6

Please sign in to comment.