staging: comedi: have comedi_set_spriv() allocate the memory
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 19 Jun 2013 22:24:36 +0000 (15:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jun 2013 22:46:56 +0000 (15:46 -0700)
commit0480bcb9fb5e279df9d39f21bb0e87ab15b5092a
tree46fc47b3121ee4355f780bfcf570f4e7c02d5ad9
parent2eb226dcedd0257ae0d712f0c0c0c35de24465ea
staging: comedi: have comedi_set_spriv() allocate the memory

As suggested by Ian Abbott, comedi_set_spriv() can only be used to
set the subdevice->private pointer to something that can be kfree()'d.
Rename the function to comedi_alloc_spriv() and have it kzalloc() the
memory as well as set the private pointer. This saves a function call
in the drivers and avoids the possibility of incorrectly calling
comedi_set_spriv() for some pointer that is not meant to be kfree()'d.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers/8255.c
drivers/staging/comedi/drivers/addi_watchdog.c
drivers/staging/comedi/drivers/amplc_dio200_common.c
drivers/staging/comedi/drivers/ni_65xx.c