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
37a8cf39
Commit
37a8cf39
authored
2 years ago
by
Vaibhav Gupta
Browse files
Options
Downloads
Patches
Plain Diff
fixup! fmc-eeprom: Use "nvmem_device_find()" to get nvmem device
parent
b041a2c2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/fmc/fmc-eeprom.c
+2
-14
2 additions, 14 deletions
drivers/fmc/fmc-eeprom.c
with
2 additions
and
14 deletions
drivers/fmc/fmc-eeprom.c
+
2
−
14
View file @
37a8cf39
...
...
@@ -88,7 +88,7 @@ static void fmc_slot_eeprom_init_default(struct fmc_slot *slot,
* about the parent device which is handled by i2c.
* One pattern which is helpful is that the nvmem framework names its
* devices by just appending an id to the name of the parent device. So,
* if the parent device is "2-0050", the nvmem device will be 2-005<id>.
* if the parent device is "2-0050", the nvmem device will be 2-005
0
<id>.
*
* The silver lining in our case is that as per FMC standard, we have only
* one eeprom/nvmem device per i2c handler. Thus, we just need to check
...
...
@@ -100,19 +100,7 @@ int fmc_nvmem_device_find_match(struct device *dev, const void *data)
const
char
*
s1
=
dev_name
(
dev
);
const
char
*
s2
=
(
const
char
*
)
data
;
while
(
*
s2
&&
*
s1
==
*
s2
)
{
s1
++
;
s2
++
;
}
/**
* If s2 is terminating with newline-then-NULL, the loop will break
* and *s2 will be still valid. Thus, check if we are out of loop
* because of newline?
*/
if
(
!*
s2
||
*
s2
==
'\n'
)
return
true
;
return
false
;
return
memcmp
(
s1
,
s2
,
strlen
(
s2
))
?
false
:
true
;
}
/**
...
...
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