From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@suse.de>, <ss@aao.gov.au>
Subject: [PATCH] Staging: dt3155: remove useless dt3155_major parameter
Date: Thu, 29 Jul 2010 09:35:57 -0700 [thread overview]
Message-ID: <201007290935.57883.hartleys@visionengravers.com> (raw)
The dt3155_major variable was never exposed as a parameter so just make it
static and always allocate a dynamic major when registering the driver.
Also, remove a couple unnecessary comments and printk noise associated with
the major/minor numbers and registration.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Scott Smedley <ss@aao.gov.au>
---
diff --git a/drivers/staging/dt3155/dt3155_drv.c b/drivers/staging/dt3155/dt3155_drv.c
index 7316996..95f9f0c 100644
--- a/drivers/staging/dt3155/dt3155_drv.c
+++ b/drivers/staging/dt3155/dt3155_drv.c
@@ -97,14 +97,7 @@ int dt3155_errno = 0;
/* wait queue for interrupts */
wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
-/* set to dynamicaly allocate, but it is tunable: */
-/* insmod DT_3155 dt3155 dt3155_major=XX */
-int dt3155_major = 0;
-
-/* The minor numbers are 0 and 1 ... they are not tunable.
- * They are used as the indices for the structure vectors,
- * and register address vectors
- */
+static int dt3155_major;
/* Global structures and variables */
@@ -955,16 +948,9 @@ static int __init dt3155_init(void)
printk(KERN_INFO "DT3155: Loading module...\n");
/* Register the device driver */
- rcode = register_chrdev(dt3155_major, "dt3155", &dt3155_fops);
- if(rcode < 0)
- {
- printk(KERN_INFO "DT3155: register_chrdev failed \n");
- return rcode;
- }
-
- if(dt3155_major == 0)
- dt3155_major = rcode; /* dynamic */
-
+ dt3155_major = register_chrdev(0, "dt3155", &dt3155_fops);
+ if (dt3155_major < 0)
+ return dt3155_major;
/* init the status variables. */
/* DMA memory is taken care of in setup_buffers() */
reply other threads:[~2010-07-29 16:37 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=201007290935.57883.hartleys@visionengravers.com \
--to=hartleys@visionengravers.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ss@aao.gov.au \
/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
Powered by JetHome