diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-08 17:55:29 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-08 18:39:19 (GMT) |
commit | 34b68400ee3aabda0cd0c951fca3b8e6fd96c015 (patch) | |
tree | 5da50b4f72ca695587f586f4f8716d3f3c5cec90 /drivers/staging/comedi/drivers.c | |
parent | 6013a9a57bbe0fd147482297b04d3d848aa24b67 (diff) | |
download | linux-fsl-qoriq-34b68400ee3aabda0cd0c951fca3b8e6fd96c015.tar.xz |
staging: comedi: drivers: set dev->board_name before attaching
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>
Diffstat (limited to 'drivers/staging/comedi/drivers.c')
-rw-r--r-- | drivers/staging/comedi/drivers.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 8db9dee..09d67da 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -383,6 +383,8 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it) /* 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); @@ -423,6 +425,7 @@ int comedi_auto_config(struct device *hardware_device, /* 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); |