Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC Bus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC Bus
Commits
a923be64
Commit
a923be64
authored
Jan 23, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: add fmc_reprogram() helper function
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
23544aea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
fmc-sdb.c
kernel/fmc-sdb.c
+24
-0
fmc.h
kernel/include/linux/fmc.h
+4
-0
No files found.
kernel/fmc-sdb.c
View file @
a923be64
...
...
@@ -124,6 +124,30 @@ int fmc_free_sdb_tree(struct fmc_device *fmc)
}
EXPORT_SYMBOL
(
fmc_free_sdb_tree
);
/* This helper calls reprogram and inizialized sdb as well */
int
fmc_reprogram
(
struct
fmc_device
*
fmc
,
struct
fmc_driver
*
d
,
char
*
gw
,
int
sdb_entry
)
{
int
ret
;
ret
=
fmc
->
op
->
reprogram
(
fmc
,
d
,
gw
);
if
(
ret
<
0
)
return
ret
;
if
(
sdb_entry
<
0
)
return
ret
;
/* We are required to find SDB at a given offset */
ret
=
fmc_scan_sdb_tree
(
fmc
,
sdb_entry
);
if
(
ret
<
0
)
{
dev_err
(
fmc
->
hwdev
,
"Can't find SDB at address 0x%x
\n
"
,
sdb_entry
);
return
-
ENODEV
;
}
fmc_dump_sdb
(
fmc
);
return
0
;
}
EXPORT_SYMBOL
(
fmc_reprogram
);
static
void
__fmc_show_sdb_tree
(
struct
fmc_device
*
fmc
,
struct
sdb_array
*
arr
)
{
int
i
,
j
,
n
=
arr
->
len
,
level
=
arr
->
level
;
...
...
kernel/include/linux/fmc.h
View file @
a923be64
...
...
@@ -142,6 +142,10 @@ struct fmc_operations {
int
(
*
write_ee
)(
struct
fmc_device
*
fmc
,
int
pos
,
const
void
*
d
,
int
l
);
};
/* Prefer this helper trather than calling of fmc->reprogram directly */
extern
int
fmc_reprogram
(
struct
fmc_device
*
f
,
struct
fmc_driver
*
d
,
char
*
gw
,
int
sdb_entry
);
/*
* The device reports all information needed to access hw.
*
...
...
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