Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
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
Commits
1af4ca96
Commit
1af4ca96
authored
Apr 01, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv:compat: better loading structure to suppress warnings
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
e7558452
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
spec-compat.c
kernel/spec-compat.c
+20
-12
No files found.
kernel/spec-compat.c
View file @
1af4ca96
...
...
@@ -151,32 +151,40 @@ struct fpga_manager *fpga_mgr_get(struct device *dev)
}
#endif
int
compat_spec_fw_load
(
struct
spec_dev
*
spec
,
const
char
*
name
)
{
struct
fpga_manager
*
mgr
;
struct
fpga_image_info
image
;
int
err
;
mgr
=
fpga_mgr_get
(
&
spec
->
dev
);
if
(
IS_ERR
(
mgr
))
return
-
ENODEV
;
static
int
__compat_spec_fw_load
(
struct
fpga_manager
*
mgr
,
const
char
*
name
)
{
#if KERNEL_VERSION(4,16,0) > LINUX_VERSION_CODE && !defined(CONFIG_FPGA_MGR_BACKPORT)
#if KERNEL_VERSION(4,10,0) > LINUX_VERSION_CODE
err
=
fpga_mgr_firmware_load
(
mgr
,
0
,
name
);
return
fpga_mgr_firmware_load
(
mgr
,
0
,
name
);
#else
struct
fpga_image_info
image
;
memset
(
&
image
,
0
,
sizeof
(
image
));
err
=
fpga_mgr_firmware_load
(
mgr
,
&
image
,
name
);
return
fpga_mgr_firmware_load
(
mgr
,
&
image
,
name
);
#endif
#else
struct
fpga_image_info
image
;
memset
(
&
image
,
0
,
sizeof
(
image
));
image
.
firmware_name
=
(
char
*
)
name
;
image
.
dev
=
&
spec
->
dev
;
mgr
=
spec
->
mgr
;
err
=
fpga_mgr_load
(
mgr
,
&
image
);
return
fpga_mgr_load
(
mgr
,
&
image
);
#endif
}
int
compat_spec_fw_load
(
struct
spec_dev
*
spec
,
const
char
*
name
)
{
struct
fpga_manager
*
mgr
;
int
err
;
mgr
=
fpga_mgr_get
(
&
spec
->
dev
);
if
(
IS_ERR
(
mgr
))
return
-
ENODEV
;
err
=
__compat_spec_fw_load
(
mgr
,
name
);
fpga_mgr_put
(
mgr
);
return
err
;
...
...
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