For aesthetic reasons, hookup the comedi_device (*open) and (*close) functions after everything else in the attach has succeeded. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxx> --- drivers/staging/comedi/drivers/serial2002.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index a596da8..16ff16e 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -751,8 +751,6 @@ static int serial2002_attach(struct comedi_device *dev, return -ENOMEM; dev->private = devpriv; - dev->open = serial_2002_open; - dev->close = serial_2002_close; devpriv->port = it->options[0]; devpriv->speed = it->options[1]; @@ -806,6 +804,9 @@ static int serial2002_attach(struct comedi_device *dev, s->range_table = NULL; s->insn_read = serial2002_encoder_insn_read; + dev->open = serial_2002_open; + dev->close = serial_2002_close; + return 0; } -- 1.8.1.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel