Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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 ADC 100M 14b 4cha
Commits
8e53d9d4
Commit
8e53d9d4
authored
Sep 11, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv: check FMC presence before loading
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
c6a9bedd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
fmc-adc-100m14b4ch-spec-core.c
kernel/fmc-adc-100m14b4ch-spec-core.c
+18
-1
No files found.
kernel/fmc-adc-100m14b4ch-spec-core.c
View file @
8e53d9d4
...
...
@@ -7,6 +7,7 @@
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/fmc.h>
#include "platform_data/fmc-adc-100m14b4cha.h"
...
...
@@ -51,6 +52,22 @@ static int fa_spec_probe(struct platform_device *pdev) {
struct
resource
*
r
;
int
irq
;
int
dma_dev_chan
;
struct
fmc_slot
*
slot
;
bool
present
;
slot
=
fmc_slot_get
(
pdev
->
dev
.
parent
,
1
);
if
(
IS_ERR
(
slot
))
{
dev_err
(
&
pdev
->
dev
,
"Can't find FMC slot 1 err: %ld
\n
"
,
PTR_ERR
(
slot
));
return
PTR_ERR
(
slot
);
}
present
=
fmc_slot_present
(
slot
);
fmc_slot_put
(
slot
);
if
(
!
present
)
{
dev_err
(
&
pdev
->
dev
,
"FMC slot: 1, not present
\n
"
);
return
-
ENODEV
;
}
rmem
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
rmem
)
{
...
...
@@ -118,7 +135,7 @@ static const struct platform_device_id fa_spec_id_table[] = {
static
struct
platform_driver
fa_spec_driver
=
{
.
driver
=
{
.
name
=
"fmc-adc-spec"
,
.
name
=
"fmc-adc-
100m-
spec"
,
.
owner
=
THIS_MODULE
,
},
.
id_table
=
fa_spec_id_table
,
...
...
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