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 <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfondation.org>
---
 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@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to