staging: comedi: simplify comedi_auto_attach()
authorIan Abbott <abbotti@mev.co.uk>
Wed, 14 Nov 2012 13:10:38 +0000 (13:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Nov 2012 00:25:48 +0000 (16:25 -0800)
commita588da1d5aac72801df0c83075225a6074c81ac5
tree2aee0aed0d9dfa8ea5197ead05d40d117129f8fe
parentaf448aca8fa41789aec8a968a56ed0868c803a2b
staging: comedi: simplify comedi_auto_attach()

`comedi_auto_config()` just calls internal function
`comedi_auto_config_helper()`, passing it a wrapper function
`comedi_auto_config_wrapper()` to handle the specifics of checking and
calling the low-level comedi driver's `auto_attach()` handler.

Since there are no other callers of `comedi_auto_config_helper()` or
`comedi_auto_config_wrapper()`, combine everything into the single
exported function `comedi_auto_config()`.

Change the ordering of the check for existence of the low-level comedi
driver's `auto_attach()` handler and the allocation of the comedi minor
device number.  This means the log message warning of the absence of the
handler now has to be refer to the hardware device instead of the
not-yet-allocated comedi device.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c