From: H Hartley Sweeten Date: Thu, 14 Apr 2016 16:57:49 +0000 (-0700) Subject: staging: comedi: ni_mio_common: remove some unnecessary BUG_ON() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf2388b1eab18018cb469c7c55b837b1da911043;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: ni_mio_common: remove some unnecessary BUG_ON() The mite dma channels are only requested by a subdevice with a (*do_cmd) and they are released by a (*cancel). The comedi core will only call the (*do_cmd) if the subdevice is not already running a command and all commands are terminated by the core with a (*cancel). Remove the BUG_ON() checks in the request functions which can never happen. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 71c8fd2cfff6..7a326058965c 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -665,7 +665,6 @@ static int ni_request_ai_mite_channel(struct comedi_device *dev) unsigned long flags; spin_lock_irqsave(&devpriv->mite_channel_lock, flags); - BUG_ON(devpriv->ai_mite_chan); devpriv->ai_mite_chan = mite_request_channel(devpriv->mite, devpriv->ai_mite_ring); if (!devpriv->ai_mite_chan) { @@ -686,7 +685,6 @@ static int ni_request_ao_mite_channel(struct comedi_device *dev) unsigned long flags; spin_lock_irqsave(&devpriv->mite_channel_lock, flags); - BUG_ON(devpriv->ao_mite_chan); devpriv->ao_mite_chan = mite_request_channel(devpriv->mite, devpriv->ao_mite_ring); if (!devpriv->ao_mite_chan) { @@ -710,7 +708,6 @@ static int ni_request_gpct_mite_channel(struct comedi_device *dev, struct mite_channel *mite_chan; spin_lock_irqsave(&devpriv->mite_channel_lock, flags); - BUG_ON(devpriv->counter_dev->counters[gpct_index].mite_chan); mite_chan = mite_request_channel(devpriv->mite, devpriv->gpct_mite_ring[gpct_index]); @@ -737,7 +734,6 @@ static int ni_request_cdo_mite_channel(struct comedi_device *dev) unsigned long flags; spin_lock_irqsave(&devpriv->mite_channel_lock, flags); - BUG_ON(devpriv->cdo_mite_chan); devpriv->cdo_mite_chan = mite_request_channel(devpriv->mite, devpriv->cdo_mite_ring); if (!devpriv->cdo_mite_chan) {