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
342e390b
Commit
342e390b
authored
May 04, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: ask app_offset only once
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
c0ba199b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
spec-core-fpga.c
software/kernel/spec-core-fpga.c
+6
-7
No files found.
software/kernel/spec-core-fpga.c
View file @
342e390b
...
...
@@ -728,12 +728,11 @@ static int spec_fpga_app_id_build(struct spec_fpga *spec_fpga,
}
static
int
spec_fpga_app_init_res_mem
(
struct
spec_fpga
*
spec_fpga
,
struct
resource
*
res
)
unsigned
int
app_offset
,
struct
resource
*
res
)
{
struct
pci_dev
*
pcidev
=
to_pci_dev
(
spec_fpga
->
dev
.
parent
);
unsigned
long
app_offset
;
app_offset
=
spec_fpga_csr_app_offset
(
spec_fpga
);
if
(
!
app_offset
)
return
-
ENODEV
;
...
...
@@ -797,14 +796,15 @@ static int spec_fpga_app_init(struct spec_fpga *spec_fpga)
struct
resource
*
res
;
struct
platform_device
*
pdev
;
char
app_name
[
SPEC_FPGA_APP_NAME_MAX
];
unsigned
int
app_offset
;
int
err
=
0
;
app_offset
=
spec_fpga_csr_app_offset
(
spec_fpga
);
res
=
kcalloc
(
SPEC_FPGA_APP_RES_N
,
sizeof
(
*
res
),
GFP_KERNEL
);
if
(
!
res
)
return
-
ENOMEM
;
err
=
spec_fpga_app_init_res_mem
(
spec_fpga
,
err
=
spec_fpga_app_init_res_mem
(
spec_fpga
,
app_offset
,
&
res
[
SPEC_FPGA_APP_RES_MEM
]);
if
(
err
)
{
dev_warn
(
&
spec_fpga
->
dev
,
"Application not found
\n
"
);
...
...
@@ -817,8 +817,7 @@ static int spec_fpga_app_init(struct spec_fpga *spec_fpga)
&
res
[
SPEC_FPGA_APP_RES_IRQ_START
],
SPEC_FPGA_APP_RES_IRQ_N
);
err
=
spec_fpga_app_id_build
(
spec_fpga
,
spec_fpga_csr_app_offset
(
spec_fpga
),
err
=
spec_fpga_app_id_build
(
spec_fpga
,
app_offset
,
app_name
,
SPEC_FPGA_APP_NAME_MAX
);
if
(
err
)
goto
err_free
;
...
...
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