Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2dff0579
Commit
2dff0579
authored
Apr 17, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SERIAL] Use module_param/module_param_array
Update serial to use new module parameters rather than MODULE_PARM.
parent
ae1b4721
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
22 deletions
+20
-22
drivers/serial/8250.c
drivers/serial/8250.c
+11
-15
drivers/serial/serial_cs.c
drivers/serial/serial_cs.c
+9
-7
No files found.
drivers/serial/8250.c
View file @
2dff0579
...
...
@@ -21,6 +21,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/tty.h>
#include <linux/ioport.h>
#include <linux/init.h>
...
...
@@ -117,11 +118,11 @@ static struct old_serial_port old_serial_port[] = {
#define UART_NR (ARRAY_SIZE(old_serial_port) + CONFIG_SERIAL_8250_NR_UARTS)
#if
defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
#if
def CONFIG_SERIAL_8250_RSA
#define PORT_RSA_MAX 4
static
int
probe_rsa
[
PORT_RSA_MAX
];
static
int
force_rsa
[
PORT_RSA_MAX
]
;
static
unsigned
long
probe_rsa
[
PORT_RSA_MAX
];
static
unsigned
int
probe_rsa_count
;
#endif
/* CONFIG_SERIAL_8250_RSA */
struct
uart_8250_port
{
...
...
@@ -678,18 +679,15 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
break
;
}
#if
defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
#if
def CONFIG_SERIAL_8250_RSA
/*
* Only probe for RSA ports if we got the region.
*/
if
(
up
->
port
.
type
==
PORT_16550A
&&
probeflags
&
PROBE_RSA
)
{
int
i
;
for
(
i
=
0
;
i
<
PORT_RSA_MAX
;
++
i
)
{
if
(
!
probe_rsa
[
i
]
&&
!
force_rsa
[
i
])
break
;
if
((
probe_rsa
[
i
]
==
up
->
port
.
iobase
||
force_rsa
[
i
]
==
up
->
port
.
iobase
)
&&
for
(
i
=
0
;
i
<
probe_rsa_count
;
++
i
)
{
if
(
probe_rsa
[
i
]
==
up
->
port
.
iobase
&&
__enable_rsa
(
up
))
{
up
->
port
.
type
=
PORT_RSA
;
break
;
...
...
@@ -2213,14 +2211,12 @@ EXPORT_SYMBOL(serial8250_resume_port);
MODULE_LICENSE
(
"GPL"
);
MODULE_DESCRIPTION
(
"Generic 8250/16x50 serial driver $Revision: 1.90 $"
);
MODULE_PARM
(
share_irqs
,
"i"
);
module_param
(
share_irqs
,
uint
,
0644
);
MODULE_PARM_DESC
(
share_irqs
,
"Share IRQs with other non-8250/16x50 devices"
" (unsafe)"
);
#if
defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
MODULE_PARM
(
probe_rsa
,
"1-"
__MODULE_STRING
(
PORT_RSA_MAX
)
"i"
);
#if
def CONFIG_SERIAL_8250_RSA
module_param_array
(
probe_rsa
,
ulong
,
probe_rsa_count
,
0444
);
MODULE_PARM_DESC
(
probe_rsa
,
"Probe I/O ports for RSA"
);
MODULE_PARM
(
force_rsa
,
"1-"
__MODULE_STRING
(
PORT_RSA_MAX
)
"i"
);
MODULE_PARM_DESC
(
force_rsa
,
"Force I/O ports for RSA"
);
#endif
MODULE_ALIAS_CHARDEV_MAJOR
(
TTY_MAJOR
);
drivers/serial/serial_cs.c
View file @
2dff0579
...
...
@@ -32,6 +32,7 @@
======================================================================*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
...
...
@@ -71,17 +72,18 @@ static char *version = "serial_cs.c 1.134 2002/05/04 05:48:53 (David Hinds)";
/* Bit map of interrupts to choose from */
static
u_int
irq_mask
=
0xdeb8
;
static
int
irq_list
[
4
]
=
{
-
1
};
static
int
irq_list
[
4
];
static
unsigned
int
irq_list_count
;
/* Enable the speaker? */
static
int
do_sound
=
1
;
/* Skip strict UART tests? */
static
int
buggy_uart
;
MODULE_PARM
(
irq_mask
,
"i"
);
MODULE_PARM
(
irq_list
,
"1-4i"
);
MODULE_PARM
(
do_sound
,
"i"
);
MODULE_PARM
(
buggy_uart
,
"i"
);
module_param
(
irq_mask
,
uint
,
0444
);
module_param_array
(
irq_list
,
int
,
irq_list_count
,
0444
);
module_param
(
do_sound
,
int
,
0444
);
module_param
(
buggy_uart
,
int
,
0444
);
/*====================================================================*/
...
...
@@ -221,10 +223,10 @@ static dev_link_t *serial_attach(void)
link
->
io
.
NumPorts1
=
8
;
link
->
irq
.
Attributes
=
IRQ_TYPE_EXCLUSIVE
;
link
->
irq
.
IRQInfo1
=
IRQ_INFO2_VALID
|
IRQ_LEVEL_ID
;
if
(
irq_list
[
0
]
==
-
1
)
if
(
irq_list
_count
==
0
)
link
->
irq
.
IRQInfo2
=
irq_mask
;
else
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
=
0
;
i
<
irq_list_count
;
i
++
)
link
->
irq
.
IRQInfo2
|=
1
<<
irq_list
[
i
];
link
->
conf
.
Attributes
=
CONF_ENABLE_IRQ
;
if
(
do_sound
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment