staging: comedi: unionxx5: refactor subdevice init
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Apr 2013 23:32:43 +0000 (16:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2013 19:47:54 +0000 (12:47 -0700)
commitdba89b14d44d463c33c3f49384475bd1316fe28a
treeb9b4a68c1710deeac7934f7246003a835e59e13b
parent8bee2dead8326f4144eab10126448fb58b4b2ac3
staging: comedi: unionxx5: refactor subdevice init

Change the parameters passed to __unioxx5_subdev_init(), we need
the comedi_device pointer to call __comedi_request_region() and
the 'minor' is only used in some kernel noise so remove it. Rename
the parameters 'subdev' and 'subdev_iobase' to simply 's' and
'iobase'.

Use __comedi_request_region() to request the I/O region needed by
the subdevice. Remove the attach noise as well as the error message
when the request_region() fails, comedi_request_reqion() will output
the error message if necessary.

Return -ENOMEM is the kzalloc fails instead of -1.

Fix unioxx5_attach() to use the new parameters to __unioxx5_subdev_init().
Pass on any error codes instead of -1.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/unioxx5.c
This page took 0.030194 seconds and 5 git commands to generate.