Commit 1540760c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] typhoon locking fix

Initialise the semaphore even if !MODULE
parent e04dbc40
...@@ -326,7 +326,6 @@ static int __init typhoon_init(void) ...@@ -326,7 +326,6 @@ static int __init typhoon_init(void)
return -EINVAL; return -EINVAL;
} }
typhoon_unit.iobase = io; typhoon_unit.iobase = io;
init_MUTEX(&typhoon_unit.lock);
if (mutefreq < 87000 || mutefreq > 108500) { if (mutefreq < 87000 || mutefreq > 108500) {
printk(KERN_ERR "radio-typhoon: You must set a frequency (in kHz) used when muting the card,\n"); printk(KERN_ERR "radio-typhoon: You must set a frequency (in kHz) used when muting the card,\n");
...@@ -337,6 +336,7 @@ static int __init typhoon_init(void) ...@@ -337,6 +336,7 @@ static int __init typhoon_init(void)
#endif /* MODULE */ #endif /* MODULE */
printk(KERN_INFO BANNER); printk(KERN_INFO BANNER);
init_MUTEX(&typhoon_unit.lock);
io = typhoon_unit.iobase; io = typhoon_unit.iobase;
if (!request_region(io, 8, "typhoon")) { if (!request_region(io, 8, "typhoon")) {
printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n", printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",
......
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