Input: xilinx_ps2 - allocate serio port separately
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 26 Mar 2012 00:23:19 +0000 (17:23 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 3 Apr 2012 16:57:11 +0000 (09:57 -0700)
commit271002ca7956e5ef140c02af1bd8e93063924ec6
tree23672b4bdbdcb3d651f6a7ec9e0c652287fc6d09
parent131c713fd96e251fcb18f4d2d05f263aa41bb11f
Input: xilinx_ps2 - allocate serio port separately

'struct serio' is a refcounted data structure with lifetime rules different
from 'struct xps2data'. It is quite likely that serio_unregister_port() will
try to free memory allocated by the port and that is why it should be
allocated separately.

Also switch to using platform_get/set_drvdata instead of dev_get/set_drvdata
because we are dealing with platform device.

Reported-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/serio/xilinx_ps2.c