public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <roland@topspin.com>
To: akmp@osdl.org
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH] Use LANANA-assigned major in ib_umad
Date: Thu, 27 Jan 2005 08:30:44 -0800	[thread overview]
Message-ID: <52r7k6yguj.fsf@topspin.com> (raw)

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: Roland Dreier <roland@topspin.com>

--- linux-bk.orig/drivers/infiniband/core/user_mad.c	2005-01-23 21:51:46.000000000 -0800
+++ linux-bk/drivers/infiniband/core/user_mad.c	2005-01-27 08:27:35.157195600 -0800
@@ -56,7 +56,10 @@
 
 enum {
 	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 {
@@ -97,7 +100,7 @@
 	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 DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS * 2);
 
@@ -789,10 +792,10 @@
 
 	spin_lock_init(&map_lock);
 
-	ret = alloc_chrdev_region(&base_dev, 0, IB_UMAD_MAX_PORTS * 2,
-				  "infiniband_mad");
+	ret = register_chrdev_region(base_dev, IB_UMAD_MAX_PORTS * 2,
+				     "infiniband_mad");
 	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;
 	}
 

                 reply	other threads:[~2005-01-27 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52r7k6yguj.fsf@topspin.com \
    --to=roland@topspin.com \
    --cc=akmp@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox