Commit 49263e20 authored by Andrew Morton's avatar Andrew Morton Committed by Dave Jones

[PATCH] make cdevname() callable from interrupts

We just made bdevname() irq-safe.  This patch makes cdevname() callable from
interrupts as well.
parent 4976a07d
......@@ -150,7 +150,7 @@ int register_chrdev_region(unsigned int major, unsigned int baseminor,
i = major_to_index(major);
write_lock(&chrdevs_lock);
write_lock_irq(&chrdevs_lock);
for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next)
if ((*cp)->major > major ||
((*cp)->major == major && (*cp)->baseminor >= baseminor))
......@@ -162,7 +162,7 @@ int register_chrdev_region(unsigned int major, unsigned int baseminor,
cd->next = *cp;
*cp = cd;
}
write_unlock(&chrdevs_lock);
write_unlock_irq(&chrdevs_lock);
return ret;
}
......@@ -183,7 +183,7 @@ int unregister_chrdev_region(unsigned int major, unsigned int baseminor,
i = major_to_index(major);
write_lock(&chrdevs_lock);
write_lock_irq(&chrdevs_lock);
for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next)
if ((*cp)->major == major &&
(*cp)->baseminor == baseminor &&
......@@ -196,7 +196,7 @@ int unregister_chrdev_region(unsigned int major, unsigned int baseminor,
*cp = cd->next;
kfree(cd);
}
write_unlock(&chrdevs_lock);
write_unlock_irq(&chrdevs_lock);
return ret;
}
......
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