BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
379eee2f
Commit
379eee2f
authored
Jan 24, 2018
by
David Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mt7697q: Centralize repeated error messages
parent
22f5b0fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
28 deletions
+20
-28
io.c
linux_kernel_modules/mt7697q/io.c
+20
-28
No files found.
linux_kernel_modules/mt7697q/io.c
View file @
379eee2f
...
...
@@ -53,24 +53,20 @@ cleanup:
static
int
mt7697io_write32
(
struct
mt7697q_info
*
qinfo
,
u8
reg
,
u32
value
)
{
int
ret
;
WARN_ON
(
reg
%
sizeof
(
u32
));
ret
=
mt7697io_write16
(
qinfo
,
reg
,
BF_GET
(
value
,
0
,
16
));
if
(
ret
<
0
)
{
dev_err
(
qinfo
->
dev
,
"%s(): mt7697io_write16() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
}
if
(
ret
<
0
)
goto
fail
;
ret
=
mt7697io_write16
(
qinfo
,
reg
+
2
,
BF_GET
(
value
,
16
,
16
));
if
(
ret
<
0
)
{
dev_err
(
qinfo
->
dev
,
"%s(): mt7697io_write16() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
}
if
(
ret
<
0
)
goto
fail
;
cleanup:
return
ret
;
fail:
dev_err
(
qinfo
->
dev
,
"%s(): mt7697io_write16() failed(%d)
\n
"
,
__func__
,
ret
);
return
ret
;
}
...
...
@@ -102,26 +98,22 @@ static int mt7697io_read32(struct mt7697q_info *qinfo, u8 reg, u32 *value)
int
ret
;
u16
low
;
u16
high
;
WARN_ON
(
reg
%
sizeof
(
u32
));
ret
=
mt7697io_read16
(
qinfo
,
reg
,
&
low
);
if
(
ret
<
0
)
{
dev_err
(
qinfo
->
dev
,
"%s(): mt7697io_read16() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
}
ret
=
mt7697io_read16
(
qinfo
,
reg
,
&
low
);
if
(
ret
<
0
)
goto
fail
;
ret
=
mt7697io_read16
(
qinfo
,
reg
+
sizeof
(
u16
),
&
high
);
if
(
ret
<
0
)
{
dev_err
(
qinfo
->
dev
,
"%s(): mt7697io_read16() failed(%d)
\n
"
,
__func__
,
ret
);
goto
cleanup
;
}
if
(
ret
<
0
)
goto
fail
;
*
value
=
(
low
|
(
high
<<
16
));
cleanup:
return
ret
;
return
ret
;
fail:
dev_err
(
qinfo
->
dev
,
"%s(): mt7697io_read16() failed(%d)
\n
"
,
__func__
,
ret
);
return
ret
;
}
static
int
mt7697io_chk_slave_busy
(
struct
mt7697q_info
*
qinfo
,
bool
*
slave_busy
)
...
...
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