Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC - Software
Commits
3fff8bb9
Commit
3fff8bb9
authored
Aug 02, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc-trivial: use validate and generic parameters
parent
4fefdec7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
fmc-trivial.c
kernel/fmc-trivial.c
+11
-0
No files found.
kernel/fmc-trivial.c
View file @
3fff8bb9
...
...
@@ -8,6 +8,8 @@
static
char
*
t_filename
;
module_param_named
(
file
,
t_filename
,
charp
,
0444
);
static
struct
fmc_driver
t_drv
;
/* initialized later */
irqreturn_t
t_handler
(
int
irq
,
void
*
dev_id
)
{
struct
fmc_device
*
fmc
=
dev_id
;
...
...
@@ -20,6 +22,11 @@ irqreturn_t t_handler(int irq, void *dev_id)
int
t_probe
(
struct
fmc_device
*
fmc
)
{
int
ret
;
int
index
;
index
=
fmc
->
op
->
validate
(
fmc
,
&
t_drv
);
if
(
index
<
0
)
return
-
EINVAL
;
/* not our device: invalid */
ret
=
fmc
->
op
->
irq_request
(
fmc
,
t_handler
,
"fmc-trivial"
,
0
);
if
(
ret
<
0
)
...
...
@@ -29,6 +36,8 @@ int t_probe(struct fmc_device *fmc)
ret
=
fmc
->
op
->
reprogram
(
fmc
,
""
);
if
(
ret
<
0
)
fmc
->
op
->
irq_free
(
fmc
);
/* FIXME: reprogram LM32 too */
return
ret
;
}
...
...
@@ -45,6 +54,8 @@ static struct fmc_driver t_drv = {
/* no table, as the current match just matches everything */
};
FMC_MODULE_PARAMS
(
t_drv
);
/* We accept the generic parameters */
static
int
t_init
(
void
)
{
int
ret
;
...
...
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