Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39671
b: refs/heads/master
c: 8ff22ea
h: refs/heads/master
i:
  39669: 9e94860
  39667: 2cb7b06
  39663: 8963f96
v: v3
  • Loading branch information
Jeff Garzik authored and Dmitry Torokhov committed Nov 3, 2006
1 parent 10aa4b7 commit 0d8cdf2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8dd51650baf0861b0a73acb2c08bb944aa45bc61
refs/heads/master: 8ff22ea7d29d99b3dbec08fd541eb406c6775ec1
12 changes: 10 additions & 2 deletions trunk/drivers/input/mouse/trackpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
struct ps2dev *ps2dev = &psmouse->ps2dev;
unsigned char firmware_id;
unsigned char button_info;
int error;

if (trackpoint_start_protocol(psmouse, &firmware_id))
return -1;
Expand All @@ -305,7 +306,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
button_info = 0;
}

psmouse->private = priv = kcalloc(1, sizeof(struct trackpoint_data), GFP_KERNEL);
psmouse->private = priv = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);
if (!priv)
return -1;

Expand All @@ -318,7 +319,14 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties)
trackpoint_defaults(priv);
trackpoint_sync(psmouse);

sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
if (error) {
printk(KERN_ERR
"trackpoint.c: failed to create sysfs attributes, error: %d\n",
error);
kfree(priv);
return -1;
}

printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n",
firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f);
Expand Down

0 comments on commit 0d8cdf2

Please sign in to comment.