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
146f9d91
Commit
146f9d91
authored
Oct 15, 2020
by
Jiri Kosina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-5.10/wiimote' into for-linus
- code cleanups for hid-wiimote
parents
df975502
5eae59cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
drivers/hid/hid-wiimote-core.c
drivers/hid/hid-wiimote-core.c
+4
-6
No files found.
drivers/hid/hid-wiimote-core.c
View file @
146f9d91
...
@@ -1586,7 +1586,7 @@ struct wiiproto_handler {
...
@@ -1586,7 +1586,7 @@ struct wiiproto_handler {
void
(
*
func
)(
struct
wiimote_data
*
wdata
,
const
__u8
*
payload
);
void
(
*
func
)(
struct
wiimote_data
*
wdata
,
const
__u8
*
payload
);
};
};
static
struct
wiiproto_handler
handlers
[]
=
{
static
const
struct
wiiproto_handler
handlers
[]
=
{
{
.
id
=
WIIPROTO_REQ_STATUS
,
.
size
=
6
,
.
func
=
handler_status
},
{
.
id
=
WIIPROTO_REQ_STATUS
,
.
size
=
6
,
.
func
=
handler_status
},
{
.
id
=
WIIPROTO_REQ_STATUS
,
.
size
=
2
,
.
func
=
handler_status_K
},
{
.
id
=
WIIPROTO_REQ_STATUS
,
.
size
=
2
,
.
func
=
handler_status_K
},
{
.
id
=
WIIPROTO_REQ_DATA
,
.
size
=
21
,
.
func
=
handler_data
},
{
.
id
=
WIIPROTO_REQ_DATA
,
.
size
=
21
,
.
func
=
handler_data
},
...
@@ -1618,19 +1618,19 @@ static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report,
...
@@ -1618,19 +1618,19 @@ static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report,
u8
*
raw_data
,
int
size
)
u8
*
raw_data
,
int
size
)
{
{
struct
wiimote_data
*
wdata
=
hid_get_drvdata
(
hdev
);
struct
wiimote_data
*
wdata
=
hid_get_drvdata
(
hdev
);
struct
wiiproto_handler
*
h
;
const
struct
wiiproto_handler
*
h
;
int
i
;
int
i
;
unsigned
long
flags
;
unsigned
long
flags
;
if
(
size
<
1
)
if
(
size
<
1
)
return
-
EINVAL
;
return
-
EINVAL
;
spin_lock_irqsave
(
&
wdata
->
state
.
lock
,
flags
);
for
(
i
=
0
;
handlers
[
i
].
id
;
++
i
)
{
for
(
i
=
0
;
handlers
[
i
].
id
;
++
i
)
{
h
=
&
handlers
[
i
];
h
=
&
handlers
[
i
];
if
(
h
->
id
==
raw_data
[
0
]
&&
h
->
size
<
size
)
{
if
(
h
->
id
==
raw_data
[
0
]
&&
h
->
size
<
size
)
{
spin_lock_irqsave
(
&
wdata
->
state
.
lock
,
flags
);
h
->
func
(
wdata
,
&
raw_data
[
1
]);
h
->
func
(
wdata
,
&
raw_data
[
1
]);
spin_unlock_irqrestore
(
&
wdata
->
state
.
lock
,
flags
);
break
;
break
;
}
}
}
}
...
@@ -1639,8 +1639,6 @@ static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report,
...
@@ -1639,8 +1639,6 @@ static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report,
hid_warn
(
hdev
,
"Unhandled report %hhu size %d
\n
"
,
raw_data
[
0
],
hid_warn
(
hdev
,
"Unhandled report %hhu size %d
\n
"
,
raw_data
[
0
],
size
);
size
);
spin_unlock_irqrestore
(
&
wdata
->
state
.
lock
,
flags
);
return
0
;
return
0
;
}
}
...
...
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