Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
cf5cbf9f
Commit
cf5cbf9f
authored
Aug 02, 2010
by
Benjamin Herrenschmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
powerpc/nvram: Add nvram_find_partition()
Signed-off-by:
Benjamin Herrenschmidt
<
benh@kernel.crashing.org
>
parent
fa2b4e54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
arch/powerpc/kernel/nvram_64.c
arch/powerpc/kernel/nvram_64.c
+22
-0
No files found.
arch/powerpc/kernel/nvram_64.c
View file @
cf5cbf9f
...
...
@@ -429,6 +429,28 @@ static int nvram_get_partition_size(loff_t data_index)
}
/**
* nvram_find_partition - Find an nvram partition by signature and name
* @name: Name of the partition or NULL for any name
* @sig: Signature to test against
* @out_size: if non-NULL, returns the size of the data part of the partition
*/
loff_t
nvram_find_partition
(
const
char
*
name
,
int
sig
,
int
*
out_size
)
{
struct
nvram_partition
*
p
;
list_for_each_entry
(
p
,
&
nvram_part
->
partition
,
partition
)
{
if
(
p
->
header
.
signature
==
sig
&&
(
!
name
||
!
strncmp
(
p
->
header
.
name
,
name
,
12
)))
{
if
(
out_size
)
*
out_size
=
(
p
->
header
.
length
-
1
)
*
NVRAM_BLOCK_LEN
;
return
p
->
index
+
NVRAM_HEADER_LEN
;
}
}
return
0
;
}
/* nvram_setup_partition
*
* This will setup the partition we need for buffering the
...
...
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