mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Move allocation of EvdevRec into a helper function
Makes it easier to initialise everything to the right values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -2461,13 +2461,20 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
|
||||
xf86DeleteInput(pInfo, flags);
|
||||
}
|
||||
|
||||
static EvdevPtr
|
||||
EvdevAlloc(void)
|
||||
{
|
||||
EvdevPtr pEvdev = calloc(sizeof(EvdevRec), 1);
|
||||
return pEvdev;
|
||||
}
|
||||
|
||||
static int
|
||||
EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
|
||||
{
|
||||
EvdevPtr pEvdev;
|
||||
int rc = BadAlloc;
|
||||
|
||||
if (!(pEvdev = calloc(sizeof(EvdevRec), 1)))
|
||||
if (!(pEvdev = EvdevAlloc()))
|
||||
goto error;
|
||||
|
||||
pInfo->private = pEvdev;
|
||||
|
||||
Reference in New Issue
Block a user