aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/trackpoint.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:01 -0500
commitfa395aaec823b9d1a5800913a6b5d0e6d1c5ced2 (patch)
treed599abe9f4f48f1737da50fa9a48dadfd08100e3 /drivers/input/mouse/trackpoint.c
parent3e7468313758913c5e4d372f35b271b96bad1298 (diff)
parent1f26978afd123deb22dd3c7dc75771a02f6e03f6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits) Input: appletouch - give up maintainership Input: dm355evm_kbd - switch to using sparse keymap library Input: wistron_btns - switch to using sparse keymap library Input: add generic support for sparse keymaps Input: fix memory leak in force feedback core Input: wistron - remove identification strings from DMI table Input: psmouse - remove identification strings from DMI tables Input: atkbd - remove identification strings from DMI table Input: i8042 - remove identification strings from DMI tables DMI: allow omitting ident strings in DMI tables Input: psmouse - do not carry DMI data around Input: matrix-keypad - switch to using dev_pm_ops Input: keyboard - fix lack of locking when traversing handler->h_list Input: gpio_keys - scan gpio state at probe and resume time Input: keyboard - add locking around event handling Input: usbtouchscreen - add support for ET&T TC5UH touchscreen controller Input: xpad - add two new Xbox 360 devices Input: polled device - do not start polling if interval is zero Input: polled device - schedule first poll immediately Input: add S3C24XX touchscreen driver ...
Diffstat (limited to 'drivers/input/mouse/trackpoint.c')
-rw-r--r--drivers/input/mouse/trackpoint.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index e354362f2971..63d4a67830f2 100644
--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -284,7 +284,6 @@ static int trackpoint_reconnect(struct psmouse *psmouse)
284 284
285int trackpoint_detect(struct psmouse *psmouse, bool set_properties) 285int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
286{ 286{
287 struct trackpoint_data *priv;
288 struct ps2dev *ps2dev = &psmouse->ps2dev; 287 struct ps2dev *ps2dev = &psmouse->ps2dev;
289 unsigned char firmware_id; 288 unsigned char firmware_id;
290 unsigned char button_info; 289 unsigned char button_info;
@@ -301,8 +300,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
301 button_info = 0; 300 button_info = 0;
302 } 301 }
303 302
304 psmouse->private = priv = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); 303 psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);
305 if (!priv) 304 if (!psmouse->private)
306 return -1; 305 return -1;
307 306
308 psmouse->vendor = "IBM"; 307 psmouse->vendor = "IBM";
@@ -311,7 +310,10 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
311 psmouse->reconnect = trackpoint_reconnect; 310 psmouse->reconnect = trackpoint_reconnect;
312 psmouse->disconnect = trackpoint_disconnect; 311 psmouse->disconnect = trackpoint_disconnect;
313 312
314 trackpoint_defaults(priv); 313 if ((button_info & 0x0f) >= 3)
314 __set_bit(BTN_MIDDLE, psmouse->dev->keybit);
315
316 trackpoint_defaults(psmouse->private);
315 trackpoint_sync(psmouse); 317 trackpoint_sync(psmouse);
316 318
317 error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group); 319 error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
@@ -319,7 +321,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
319 printk(KERN_ERR 321 printk(KERN_ERR
320 "trackpoint.c: failed to create sysfs attributes, error: %d\n", 322 "trackpoint.c: failed to create sysfs attributes, error: %d\n",
321 error); 323 error);
322 kfree(priv); 324 kfree(psmouse->private);
325 psmouse->private = NULL;
323 return -1; 326 return -1;
324 } 327 }
325 328