The comedi (*attach) and (*auto_attach) functions are used to attach
legacy and PnP type devices to the comedi subsystem. If we can set the
dev->board_name before doing the attach, the drivers will not have to
worry about doing it.
Drivers that do additional probing can still change the dev->board_name
if necessary.
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>
/* initialize dev->driver here so
* comedi_error() can be called from attach */
dev->driver = driv;
+ dev->board_name = dev->board_ptr ? *(const char **)dev->board_ptr
+ : dev->driver->driver_name;
ret = driv->attach(dev, it);
if (ret >= 0)
ret = comedi_device_postconfig(dev);
/* Note: comedi_alloc_board_minor() locked dev->mutex. */
dev->driver = driver;
+ dev->board_name = dev->driver->driver_name;
ret = driver->auto_attach(dev, context);
if (ret >= 0)
ret = comedi_device_postconfig(dev);