Commit fe3a3a34 authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] infiniband: use LANANA-assigned major in ib_umad

Update the ib_umad module to use major 231 instead of a dynamic major, as
assigned in the LANANA Linux 2.6+ Device List
(http://lanana.org/docs/device-list/devices-2.6+.txt).
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 68b38741
...@@ -56,7 +56,10 @@ MODULE_LICENSE("Dual BSD/GPL"); ...@@ -56,7 +56,10 @@ MODULE_LICENSE("Dual BSD/GPL");
enum { enum {
IB_UMAD_MAX_PORTS = 64, IB_UMAD_MAX_PORTS = 64,
IB_UMAD_MAX_AGENTS = 32 IB_UMAD_MAX_AGENTS = 32,
IB_UMAD_MAJOR = 231,
IB_UMAD_MINOR_BASE = 0
}; };
struct ib_umad_port { struct ib_umad_port {
...@@ -97,7 +100,7 @@ struct ib_umad_packet { ...@@ -97,7 +100,7 @@ struct ib_umad_packet {
DECLARE_PCI_UNMAP_ADDR(mapping) DECLARE_PCI_UNMAP_ADDR(mapping)
}; };
static dev_t base_dev; static const dev_t base_dev = MKDEV(IB_UMAD_MAJOR, IB_UMAD_MINOR_BASE);
static spinlock_t map_lock; static spinlock_t map_lock;
static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS * 2); static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS * 2);
...@@ -789,10 +792,10 @@ static int __init ib_umad_init(void) ...@@ -789,10 +792,10 @@ static int __init ib_umad_init(void)
spin_lock_init(&map_lock); spin_lock_init(&map_lock);
ret = alloc_chrdev_region(&base_dev, 0, IB_UMAD_MAX_PORTS * 2, ret = register_chrdev_region(base_dev, IB_UMAD_MAX_PORTS * 2,
"infiniband_mad"); "infiniband_mad");
if (ret) { if (ret) {
printk(KERN_ERR "user_mad: couldn't get device number\n"); printk(KERN_ERR "user_mad: couldn't register device number\n");
goto out; goto out;
} }
......
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