Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FMC Software Support
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
FMC Software Support
Commits
28a87aef
Commit
28a87aef
authored
1 year ago
by
Federico Vaga
Browse files
Options
Downloads
Patches
Plain Diff
fmc: make preprocessor conditions consistent
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
92c324fc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#5119
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/fmc/fmc-eeprom.c
+15
-15
15 additions, 15 deletions
drivers/fmc/fmc-eeprom.c
with
15 additions
and
15 deletions
drivers/fmc/fmc-eeprom.c
+
15
−
15
View file @
28a87aef
...
...
@@ -70,11 +70,11 @@ static void fmc_slot_eeprom_init_default(struct fmc_slot *slot,
{
memset
(
info
,
0
,
sizeof
(
*
info
));
fmc_slot_eeprom_init
(
slot
,
info
,
FMC_EEPROM_TYPE_DEFAULT
);
#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE
#if KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
memcpy
(
slot
->
at24_data
,
&
at24_24c02
,
sizeof
(
slot
->
at24_data
));
#else
memcpy
(
&
slot
->
at24_data
,
&
at24_24c02
,
sizeof
(
slot
->
at24_data
));
slot
->
at24_data
.
context
=
slot
;
#else
memcpy
(
slot
->
at24_data
,
&
at24_24c02
,
sizeof
(
slot
->
at24_data
));
#endif
}
...
...
@@ -286,10 +286,10 @@ int fmc_slot_eeprom_type_set(struct fmc_slot *slot, const char *type)
memset
(
&
i2c_info
,
0
,
sizeof
(
i2c_info
));
#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE
memset
(
&
slot
->
at24_data
,
0
,
sizeof
(
slot
->
at24_data
));
#else
#if KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
memset
(
slot
->
at24_data
,
0
,
sizeof
(
slot
->
at24_data
));
#else
memset
(
&
slot
->
at24_data
,
0
,
sizeof
(
slot
->
at24_data
));
#endif
len
=
(
len
*
1024
)
/
8
;
...
...
@@ -302,7 +302,15 @@ int fmc_slot_eeprom_type_set(struct fmc_slot *slot, const char *type)
fmc_slot_eeprom_init
(
slot
,
&
i2c_info
,
type
);
#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE
#if KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
slot
->
at24_data
[
0
]
=
PROPERTY_ENTRY_U32
(
"size"
,
len
);
slot
->
at24_data
[
1
]
=
PROPERTY_ENTRY_U32
(
"pagesize"
,
1
);
if
(
len
>
4096
)
/* 32K 4KiB */
slot
->
at24_data
[
2
]
=
PROPERTY_ENTRY_U32
(
"address-width"
,
16
);
dev_dbg
(
&
slot
->
dev
,
"%s 0x%x %d
\n
"
,
i2c_info
.
type
,
i2c_info
.
addr
,
len
);
#else
if
(
len
>
4096
)
/* 32K 4KiB */
slot
->
at24_data
.
flags
=
AT24_FLAG_ADDR16
;
slot
->
at24_data
.
byte_len
=
len
;
...
...
@@ -314,14 +322,6 @@ int fmc_slot_eeprom_type_set(struct fmc_slot *slot, const char *type)
i2c_info
.
type
,
i2c_info
.
addr
,
slot
->
at24_data
.
byte_len
,
slot
->
at24_data
.
page_size
,
slot
->
at24_data
.
flags
);
#else
slot
->
at24_data
[
0
]
=
PROPERTY_ENTRY_U32
(
"size"
,
len
);
slot
->
at24_data
[
1
]
=
PROPERTY_ENTRY_U32
(
"pagesize"
,
1
);
if
(
len
>
4096
)
/* 32K 4KiB */
slot
->
at24_data
[
2
]
=
PROPERTY_ENTRY_U32
(
"address-width"
,
16
);
dev_dbg
(
&
slot
->
dev
,
"%s 0x%x %d
\n
"
,
i2c_info
.
type
,
i2c_info
.
addr
,
len
);
#endif
return
fmc_slot_eeprom_replace
(
slot
,
&
i2c_info
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment