Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
svec-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
fmc-projects
svec
svec-sw
Commits
c085d660
Commit
c085d660
authored
Jun 11, 2015
by
Federico Vaga
Committed by
Federico Vaga
Oct 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: fail only when all FMC prepare fail
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
28431f5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
svec-fmc.c
kernel/svec-fmc.c
+18
-5
No files found.
kernel/svec-fmc.c
View file @
c085d660
...
...
@@ -189,6 +189,8 @@ int svec_fmc_prepare(struct svec_dev *svec, unsigned int fmc_slot)
struct
fmc_device
*
fmc
;
int
ret
=
0
;
svec
->
fmcs
[
fmc_slot
]
=
NULL
;
if
(
fmc_slot
>=
SVEC_N_SLOTS
)
return
-
EINVAL
;
...
...
@@ -257,13 +259,22 @@ int svec_fmc_prepare(struct svec_dev *svec, unsigned int fmc_slot)
int
svec_fmc_create
(
struct
svec_dev
*
svec
,
struct
fmc_gateware
*
gw
)
{
int
i
;
int
error
=
0
;
int
error
=
0
,
err_cnt
=
0
;
/* fmc structures filling */
for
(
i
=
0
;
i
<
svec
->
fmcs_n
;
i
++
)
{
error
=
svec_fmc_prepare
(
svec
,
i
);
if
(
error
)
goto
failed
;
if
(
error
)
{
err_cnt
++
;
dev_err
(
svec
->
dev
,
"Cannot create FMC device for FMC slot %d
\n
"
,
i
+
1
);
}
}
/* Fail only when all FMC preparations fail */
if
(
err_cnt
==
svec
->
fmcs_n
)
{
error
=
-
ENODEV
;
goto
failed
;
}
/* fmc device creation */
...
...
@@ -281,13 +292,15 @@ int svec_fmc_create(struct svec_dev *svec, struct fmc_gateware *gw)
/* scan SDB. Do not report errors, we don't care, SDB is not
mandatory for the carrier board */
for
(
i
=
0
;
i
<
svec
->
fmcs_n
;
i
++
)
fmc_scan_sdb_tree
(
svec
->
fmcs
[
i
],
0
);
if
(
svec
->
fmcs
[
i
])
fmc_scan_sdb_tree
(
svec
->
fmcs
[
i
],
0
);
return
0
;
failed:
for
(
i
=
0
;
i
<
svec
->
fmcs_n
;
i
++
)
kfree
(
svec
->
fmcs
[
i
]);
if
(
svec
->
fmcs
[
i
])
kfree
(
svec
->
fmcs
[
i
]);
/* FIXME: free fmc allocations. */
return
error
;
...
...
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