From: H Hartley Sweeten Date: Fri, 5 Apr 2013 23:11:50 +0000 (-0700) Subject: staging: comedi: serial2002: hookup the (*open) and (*close) last X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e7ccc452b20a0f6a828b0afcf8cacc2665357131;p=linux-beck.git 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 --- 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; }