From: H Hartley Sweeten Date: Thu, 18 Apr 2013 21:34:00 +0000 (-0700) Subject: staging: comedi: skel: use comedi_legacy_detach() X-Git-Tag: v3.10-rc1~192^2~42 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3fd19714e3b7b355cb52975edaeb25df6db4a9be;p=~emulex%2Finfiniband.git staging: comedi: skel: use comedi_legacy_detach() 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/skel.c b/drivers/staging/comedi/drivers/skel.c index 6dc77fc0722..dbc8c54d6da 100644 --- a/drivers/staging/comedi/drivers/skel.c +++ b/drivers/staging/comedi/drivers/skel.c @@ -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); } }