[PATCH 3/5] sonypi: use MISC_DYNAMIC_MINOR in miscdevice.minor assignment.
From: Stelian Pop
Date: Thu Feb 10 2005 - 10:50:05 EST
===================================================================
Use MISC_DYNAMIC_MINOR in miscdevice.minor assignment.
Patch-from: Olaf Hering <olh@xxxxxxx>
Signed-off-by: Stelian Pop <stelian@xxxxxxxxxx>
===================================================================
sonypi.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
===================================================================
Index: drivers/char/sonypi.c
===================================================================
--- a/drivers/char/sonypi.c (revision 26556)
+++ b/drivers/char/sonypi.c (revision 26557)
@@ -646,7 +646,7 @@ static struct file_operations sonypi_mis
};
struct miscdevice sonypi_misc_device = {
- .minor = -1,
+ .minor = MISC_DYNAMIC_MINOR,
.name = "sonypi",
.fops = &sonypi_misc_fops,
};
@@ -755,7 +755,8 @@ static int __devinit sonypi_probe(void)
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))) {
printk(KERN_ERR "sonypi: misc_register failed\n");
goto out_miscreg;
--
Stelian Pop <stelian@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/