Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
bcb7e246
Commit
bcb7e246
authored
Mar 13, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmp: serial and revisionin sysfs
parent
500de115
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
elphel393-init.c
src/drivers/elphel/elphel393-init.c
+5
-9
No files found.
src/drivers/elphel/elphel393-init.c
View file @
bcb7e246
...
...
@@ -229,26 +229,22 @@ static int elphel393_init_probe(struct platform_device *pdev)
// return -ENOMEM;
while
(
count
){
pr_info
(
"counting(
\255
/255): %d
\n
"
,
count
);
len
=
min_t
(
size_t
,
count
,
size
);
pr_info
(
"len is: %d
\n
"
,
len
);
ret
=
mtd_read_user_prot_reg
(
mtd
,
*
ppos
,
len
,
&
retlen
,
kbuf
);
if
(
!
ret
){
if
(
ret
){
pr_err
(
"flash page read, code %d"
,
ret
);
}
pr_info
(
"superfunction returned: %d"
,
ret
);
pr_info
(
"And the buf contents are: %s
\n
"
,
kbuf
);
// do whatever we like with the kbuf
// search for "<board>"
// expecting to find it somewhere...
if
(
strnstr
(
kbuf
,
"<board>"
,
size
)){
pr_info
(
"Clap along if you feel that happiness is the truth
\n
"
);
//...right in the beginning or error
ps
=
strnstr
(
kbuf
,
"<serial>"
,
size
);
strncpy
(
serial
,
ps
+
sizeof
(
"<serial>"
)
-
1
,
sizeof
(
serial
)
-
1
);
pe
=
strnstr
(
kbuf
,
"</serial>"
,
size
);
strncpy
(
serial
,
ps
+
sizeof
(
"<serial>"
)
-
1
,
pe
-
ps
-
(
sizeof
(
"<serial>"
)
-
1
));
ps
=
strnstr
(
kbuf
,
"<rev>"
,
size
);
strncpy
(
revision
,
ps
+
sizeof
(
"<rev>"
)
-
1
,
sizeof
(
revision
)
-
1
);
pe
=
strnstr
(
kbuf
,
"</rev>"
,
size
);
strncpy
(
revision
,
ps
+
sizeof
(
"<rev>"
)
-
1
,
pe
-
ps
-
(
sizeof
(
"<rev>"
)
-
1
));
strncpy
(
boardinfo
,
kbuf
,
retlen
);
break
;
...
...
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