]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: skel: use comedi_legacy_detach()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 18 Apr 2013 21:34:00 +0000 (14:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Apr 2013 18:19:54 +0000 (11:19 -0700)
Update the skeleton driver to use the new comedi_legacy_detach()
helper in the (*detach) to release the I/O region. Also, update
the comment about it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/skel.c

index 6dc77fc0722014b4f203a1de0d0a6f2d28d3027e..dbc8c54d6da7f9509d44b1cca3cf061d0d69ed1b 100644 (file)
@@ -632,11 +632,12 @@ static void skel_detach(struct comedi_device *dev)
                /*
                 * ISA board
                 *
-                * If I/O regions successfully requested by _attach(),
-                * release them here.
+                * Release the first I/O region requested during the
+                * _attach(). This is safe to call even if the request
+                * failed. If any additional I/O regions are requested
+                * they need to be released by the driver.
                 */
-               if (dev->iobase)
-                       release_region(dev->iobase, SKEL_SIZE);
+               comedi_legacy_detach(dev);
        }
 }