Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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 - Software
Commits
3e74902a
Commit
3e74902a
authored
Oct 28, 2014
by
Adam Wujek
💬
Committed by
Alessandro Rubini
Dec 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_nic: unify device.c wrn_drvdata and wrn_dev
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
cce57c8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
device.c
kernel/wr_nic/device.c
+16
-6
No files found.
kernel/wr_nic/device.c
View file @
3e74902a
...
...
@@ -23,13 +23,25 @@
#include "wr-nic.h"
#include "nic-mem.h"
#if WR_IS_NODE
/* Our platform_data is different in node vs switch */
#include "../spec-nic.h"
static
inline
struct
wrn_dev
*
wrn_from_pdev
(
struct
platform_device
*
pdev
)
{
struct
wrn_drvdata
*
drvdata
=
pdev
->
dev
.
platform_data
;
return
drvdata
->
wrn
;
}
#else
/* WR_IS_SWITCH */
static
inline
struct
wrn_dev
*
wrn_from_pdev
(
struct
platform_device
*
pdev
)
{
return
pdev
->
dev
.
platform_data
;
}
#endif
/* The remove function is used by probe, so it's not __devexit */
static
int
wrn_remove
(
struct
platform_device
*
pdev
)
{
struct
wrn_drvdata
*
drvdata
=
pdev
->
dev
.
platform_data
;
struct
wrn_dev
*
wrn
=
drvdata
->
wrn
;
struct
wrn_dev
*
wrn
=
wrn_from_pdev
(
pdev
);
int
i
;
if
(
WR_IS_SWITCH
)
{
...
...
@@ -72,8 +84,7 @@ static int __wrn_map_resources(struct platform_device *pdev)
int
i
;
struct
resource
*
res
;
void
__iomem
*
ptr
;
struct
wrn_drvdata
*
drvdata
=
pdev
->
dev
.
platform_data
;
struct
wrn_dev
*
wrn
=
drvdata
->
wrn
;
struct
wrn_dev
*
wrn
=
wrn_from_pdev
(
pdev
);
/*
* The memory regions are mapped once for all endpoints.
...
...
@@ -101,8 +112,7 @@ static int wrn_probe(struct platform_device *pdev)
{
struct
net_device
*
netdev
;
struct
wrn_ep
*
ep
;
struct
wrn_drvdata
*
drvdata
=
pdev
->
dev
.
platform_data
;
struct
wrn_dev
*
wrn
=
drvdata
->
wrn
;
struct
wrn_dev
*
wrn
=
wrn_from_pdev
(
pdev
);
int
i
,
err
=
0
;
/* Lazily: irqs are not in the resource list */
...
...
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