Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
bb3d7c7f
Commit
bb3d7c7f
authored
Feb 07, 2007
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MIPS] RTLX: Sprinkle device model code into code to make udev happier.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
27a3bbaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
arch/mips/kernel/rtlx.c
arch/mips/kernel/rtlx.c
+22
-1
No files found.
arch/mips/kernel/rtlx.c
View file @
bb3d7c7f
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
*
*
*/
*/
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/fs.h>
...
@@ -34,6 +35,7 @@
...
@@ -34,6 +35,7 @@
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/wait.h>
#include <asm/mipsmtregs.h>
#include <asm/mipsmtregs.h>
#include <asm/mips_mt.h>
#include <asm/cacheflush.h>
#include <asm/cacheflush.h>
#include <asm/atomic.h>
#include <asm/atomic.h>
#include <asm/cpu.h>
#include <asm/cpu.h>
...
@@ -498,7 +500,8 @@ static char register_chrdev_failed[] __initdata =
...
@@ -498,7 +500,8 @@ static char register_chrdev_failed[] __initdata =
static
int
rtlx_module_init
(
void
)
static
int
rtlx_module_init
(
void
)
{
{
int
i
;
struct
device
*
dev
;
int
i
,
err
;
major
=
register_chrdev
(
0
,
module_name
,
&
rtlx_fops
);
major
=
register_chrdev
(
0
,
module_name
,
&
rtlx_fops
);
if
(
major
<
0
)
{
if
(
major
<
0
)
{
...
@@ -511,6 +514,13 @@ static int rtlx_module_init(void)
...
@@ -511,6 +514,13 @@ static int rtlx_module_init(void)
init_waitqueue_head
(
&
channel_wqs
[
i
].
rt_queue
);
init_waitqueue_head
(
&
channel_wqs
[
i
].
rt_queue
);
init_waitqueue_head
(
&
channel_wqs
[
i
].
lx_queue
);
init_waitqueue_head
(
&
channel_wqs
[
i
].
lx_queue
);
channel_wqs
[
i
].
in_open
=
0
;
channel_wqs
[
i
].
in_open
=
0
;
dev
=
device_create
(
mt_class
,
NULL
,
MKDEV
(
major
,
i
),
"%s%d"
,
module_name
,
i
);
if
(
IS_ERR
(
dev
))
{
err
=
PTR_ERR
(
dev
);
goto
out_chrdev
;
}
}
}
/* set up notifiers */
/* set up notifiers */
...
@@ -525,10 +535,21 @@ static int rtlx_module_init(void)
...
@@ -525,10 +535,21 @@ static int rtlx_module_init(void)
setup_irq
(
rtlx_irq_num
,
&
rtlx_irq
);
setup_irq
(
rtlx_irq_num
,
&
rtlx_irq
);
return
0
;
return
0
;
out_chrdev:
for
(
i
=
0
;
i
<
RTLX_CHANNELS
;
i
++
)
device_destroy
(
mt_class
,
MKDEV
(
major
,
i
));
return
err
;
}
}
static
void
__exit
rtlx_module_exit
(
void
)
static
void
__exit
rtlx_module_exit
(
void
)
{
{
int
i
;
for
(
i
=
0
;
i
<
RTLX_CHANNELS
;
i
++
)
device_destroy
(
mt_class
,
MKDEV
(
major
,
i
));
unregister_chrdev
(
major
,
module_name
);
unregister_chrdev
(
major
,
module_name
);
}
}
...
...
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