2005-02-10 15:45:22

by Stelian Pop

[permalink] [raw]
Subject: [PATCH 3/5] sonypi: use MISC_DYNAMIC_MINOR in miscdevice.minor assignment.

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

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]>