Commit b9055c91 authored by Stelian Pop's avatar Stelian Pop Committed by Linus Torvalds

[PATCH] sonypi: use MISC_DYNAMIC_MINOR in miscdevice.minor assignment.

Use MISC_DYNAMIC_MINOR in miscdevice.minor assignment.

Patch-from: Olaf Hering <olh@suse.de>
Signed-off-by: default avatarStelian Pop <stelian@popies.net>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3d341831
...@@ -646,7 +646,7 @@ static struct file_operations sonypi_misc_fops = { ...@@ -646,7 +646,7 @@ static struct file_operations sonypi_misc_fops = {
}; };
struct miscdevice sonypi_misc_device = { struct miscdevice sonypi_misc_device = {
.minor = -1, .minor = MISC_DYNAMIC_MINOR,
.name = "sonypi", .name = "sonypi",
.fops = &sonypi_misc_fops, .fops = &sonypi_misc_fops,
}; };
...@@ -755,7 +755,8 @@ static int __devinit sonypi_probe(void) ...@@ -755,7 +755,8 @@ static int __devinit sonypi_probe(void)
goto out_pcienable; goto out_pcienable;
} }
sonypi_misc_device.minor = (minor == -1) ? MISC_DYNAMIC_MINOR : minor; if (minor != -1)
sonypi_misc_device.minor = minor;
if ((ret = misc_register(&sonypi_misc_device))) { if ((ret = misc_register(&sonypi_misc_device))) {
printk(KERN_ERR "sonypi: misc_register failed\n"); printk(KERN_ERR "sonypi: misc_register failed\n");
goto out_miscreg; goto out_miscreg;
......
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