===================================================================

Use MISC_DYNAMIC_MINOR in miscdevice.minor assignment.

Patch-from: Olaf Hering <[EMAIL PROTECTED]>
Signed-off-by: Stelian Pop <[EMAIL PROTECTED]>

===================================================================

 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 <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to