staging: comedi: amplc_dio200: set board_name before common attach
authorIan Abbott <abbotti@mev.co.uk>
Mon, 18 Mar 2013 17:19:04 +0000 (17:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:30:05 +0000 (11:30 -0700)
`dio200_common_attach()` is called from `dio200_attach()` for ISA boards
and from `dio200_auto_attach()` for PCI boards.  `dio200_auto_attach()`
assigns `dev->board_name` (where `dev` is the `struct comedi_device *`
under consideration) before calling `dio200_common_attach()`.  Do the
same in `dio200_attach()` so it can be used there before the call to
`dio200_common_attach()`.  This makes the assignment in
`dio200_common_attach()` unnessary, so remove the assignment from there.

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

index ab9551580758cc61691fee1930b944f7bd39f31f..b0b99840a1f588cd1b209dedb4490a078d9c8a97 100644 (file)
@@ -1738,7 +1738,6 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned int irq,
        int ret;
 
        devpriv->intr_sd = -1;
-       dev->board_name = thisboard->name;
 
        ret = comedi_alloc_subdevices(dev, layout->n_subdevs);
        if (ret)
@@ -1818,6 +1817,7 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (!DO_ISA)
                return -EINVAL;
 
+       dev->board_name = thisboard->name;
        dev_info(dev->class_dev, DIO200_DRIVER_NAME ": attach\n");
 
        devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
This page took 0.027439 seconds and 5 git commands to generate.