Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
f42649e8
Commit
f42649e8
authored
Apr 12, 2007
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: ALPS - handle errors from input_register_device()
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
f3901d9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
drivers/input/mouse/alps.c
drivers/input/mouse/alps.c
+9
-4
drivers/input/mouse/alps.h
drivers/input/mouse/alps.h
+0
-1
No files found.
drivers/input/mouse/alps.c
View file @
f42649e8
...
@@ -424,14 +424,15 @@ int alps_init(struct psmouse *psmouse)
...
@@ -424,14 +424,15 @@ int alps_init(struct psmouse *psmouse)
struct
input_dev
*
dev1
=
psmouse
->
dev
,
*
dev2
;
struct
input_dev
*
dev1
=
psmouse
->
dev
,
*
dev2
;
int
version
;
int
version
;
p
smouse
->
private
=
p
riv
=
kzalloc
(
sizeof
(
struct
alps_data
),
GFP_KERNEL
);
priv
=
kzalloc
(
sizeof
(
struct
alps_data
),
GFP_KERNEL
);
dev2
=
input_allocate_device
();
dev2
=
input_allocate_device
();
if
(
!
priv
||
!
dev2
)
if
(
!
priv
||
!
dev2
)
goto
init_fail
;
goto
init_fail
;
priv
->
dev2
=
dev2
;
priv
->
dev2
=
dev2
;
if
(
!
(
priv
->
i
=
alps_get_model
(
psmouse
,
&
version
)))
priv
->
i
=
alps_get_model
(
psmouse
,
&
version
);
if
(
!
priv
->
i
)
goto
init_fail
;
goto
init_fail
;
if
((
priv
->
i
->
flags
&
ALPS_PASS
)
&&
alps_passthrough_mode
(
psmouse
,
1
))
if
((
priv
->
i
->
flags
&
ALPS_PASS
)
&&
alps_passthrough_mode
(
psmouse
,
1
))
...
@@ -480,7 +481,8 @@ int alps_init(struct psmouse *psmouse)
...
@@ -480,7 +481,8 @@ int alps_init(struct psmouse *psmouse)
dev2
->
relbit
[
LONG
(
REL_X
)]
|=
BIT
(
REL_X
)
|
BIT
(
REL_Y
);
dev2
->
relbit
[
LONG
(
REL_X
)]
|=
BIT
(
REL_X
)
|
BIT
(
REL_Y
);
dev2
->
keybit
[
LONG
(
BTN_LEFT
)]
|=
BIT
(
BTN_LEFT
)
|
BIT
(
BTN_MIDDLE
)
|
BIT
(
BTN_RIGHT
);
dev2
->
keybit
[
LONG
(
BTN_LEFT
)]
|=
BIT
(
BTN_LEFT
)
|
BIT
(
BTN_MIDDLE
)
|
BIT
(
BTN_RIGHT
);
input_register_device
(
priv
->
dev2
);
if
(
input_register_device
(
priv
->
dev2
))
goto
init_fail
;
psmouse
->
protocol_handler
=
alps_process_byte
;
psmouse
->
protocol_handler
=
alps_process_byte
;
psmouse
->
poll
=
alps_poll
;
psmouse
->
poll
=
alps_poll
;
...
@@ -491,9 +493,11 @@ int alps_init(struct psmouse *psmouse)
...
@@ -491,9 +493,11 @@ int alps_init(struct psmouse *psmouse)
/* We are having trouble resyncing ALPS touchpads so disable it for now */
/* We are having trouble resyncing ALPS touchpads so disable it for now */
psmouse
->
resync_time
=
0
;
psmouse
->
resync_time
=
0
;
psmouse
->
private
=
priv
;
return
0
;
return
0
;
init_fail:
init_fail:
psmouse_reset
(
psmouse
);
input_free_device
(
dev2
);
input_free_device
(
dev2
);
kfree
(
priv
);
kfree
(
priv
);
return
-
1
;
return
-
1
;
...
@@ -504,7 +508,8 @@ int alps_detect(struct psmouse *psmouse, int set_properties)
...
@@ -504,7 +508,8 @@ int alps_detect(struct psmouse *psmouse, int set_properties)
int
version
;
int
version
;
const
struct
alps_model_info
*
model
;
const
struct
alps_model_info
*
model
;
if
(
!
(
model
=
alps_get_model
(
psmouse
,
&
version
)))
model
=
alps_get_model
(
psmouse
,
&
version
);
if
(
!
model
)
return
-
1
;
return
-
1
;
if
(
set_properties
)
{
if
(
set_properties
)
{
...
...
drivers/input/mouse/alps.h
View file @
f42649e8
...
@@ -20,7 +20,6 @@ struct alps_model_info {
...
@@ -20,7 +20,6 @@ struct alps_model_info {
struct
alps_data
{
struct
alps_data
{
struct
input_dev
*
dev2
;
/* Relative device */
struct
input_dev
*
dev2
;
/* Relative device */
char
name
[
32
];
/* Name */
char
phys
[
32
];
/* Phys */
char
phys
[
32
];
/* Phys */
const
struct
alps_model_info
*
i
;
/* Info */
const
struct
alps_model_info
*
i
;
/* Info */
int
prev_fin
;
/* Finger bit from previous packet */
int
prev_fin
;
/* Finger bit from previous packet */
...
...
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