From e7ccc452b20a0f6a828b0afcf8cacc2665357131 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 5 Apr 2013 16:11:50 -0700 Subject: [PATCH] staging: comedi: serial2002: hookup the (*open) and (*close) last 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- 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 a596da8ac69a..16ff16e920ab 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; } -- 2.39.5