staging: comedi: drivers: introduce comedi_request_region()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Apr 2013 23:05:54 +0000 (16:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2013 19:47:35 +0000 (12:47 -0700)
commitf375ac5f197d32aeffe5436e5864525cc14ce44a
treeb88e0220afd6049b76f2a403109c5bb53fd667ba
parentaa7a82b9f941f1e299bf9b26dcd8bb76ecce3c8f
staging: comedi: drivers: introduce comedi_request_region()

Introduce a helper function to handle the request_region() for legacy
comedi drivers.

As pointed out by Ian Abbott, legacy devices are configured manually
with the "comedi_config" program. The error messages are useful
diagnostics when trying to attach to these boards.

Providing a helper function allows consolidating the error messages
in the drivers and providing a consistent format for the errors.

This helper also sets the dev->iobase automatically for the driver
if the request_region() is successful.

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/comedidev.h
drivers/staging/comedi/drivers.c