dmaengine: kill enum dma_state_client

DMA_NAK is now useless.  We can just use a bool instead.

Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dan Williams 2009-01-06 11:38:19 -07:00
parent f27c580c36
commit 7dd6025101
4 changed files with 14 additions and 31 deletions

View File

@ -440,7 +440,7 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
{ {
struct dma_device *device, *_d; struct dma_device *device, *_d;
struct dma_chan *chan = NULL; struct dma_chan *chan = NULL;
enum dma_state_client ack; bool ack;
int err; int err;
/* Find a channel */ /* Find a channel */
@ -453,9 +453,9 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
if (fn) if (fn)
ack = fn(chan, fn_param); ack = fn(chan, fn_param);
else else
ack = DMA_ACK; ack = true;
if (ack == DMA_ACK) { if (ack) {
/* Found a suitable channel, try to grab, prep, and /* Found a suitable channel, try to grab, prep, and
* return it. We first set DMA_PRIVATE to disable * return it. We first set DMA_PRIVATE to disable
* balance_ref_count as this channel will not be * balance_ref_count as this channel will not be
@ -473,15 +473,9 @@ struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, v
dev_name(&chan->dev), err); dev_name(&chan->dev), err);
else else
break; break;
} else if (ack == DMA_DUP) {
pr_debug("%s: %s filter said DMA_DUP\n",
__func__, dev_name(&chan->dev));
} else if (ack == DMA_NAK) {
pr_debug("%s: %s filter said DMA_NAK\n",
__func__, dev_name(&chan->dev));
break;
} else } else
WARN_ONCE(1, "filter_fn: unknown response?\n"); pr_debug("%s: %s filter said false\n",
__func__, dev_name(&chan->dev));
chan = NULL; chan = NULL;
} }
mutex_unlock(&dma_list_mutex); mutex_unlock(&dma_list_mutex);

View File

@ -363,12 +363,12 @@ static int dmatest_add_channel(struct dma_chan *chan)
return 0; return 0;
} }
static enum dma_state_client filter(struct dma_chan *chan, void *param) static bool filter(struct dma_chan *chan, void *param)
{ {
if (!dmatest_match_channel(chan) || !dmatest_match_device(chan->device)) if (!dmatest_match_channel(chan) || !dmatest_match_device(chan->device))
return DMA_DUP; return false;
else else
return DMA_ACK; return true;
} }
static int __init dmatest_init(void) static int __init dmatest_init(void)

View File

@ -1544,14 +1544,14 @@ static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot,
} }
#ifdef CONFIG_MMC_ATMELMCI_DMA #ifdef CONFIG_MMC_ATMELMCI_DMA
static enum dma_state_client filter(struct dma_chan *chan, void *slave) static bool filter(struct dma_chan *chan, void *slave)
{ {
struct dw_dma_slave *dws = slave; struct dw_dma_slave *dws = slave;
if (dws->dma_dev == chan->device->dev) if (dws->dma_dev == chan->device->dev)
return DMA_ACK; return true;
else else
return DMA_DUP; return false;
} }
#endif #endif

View File

@ -28,18 +28,6 @@
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
/**
* enum dma_state_client - state of the channel in the client
* @DMA_ACK: client would like to use, or was using this channel
* @DMA_DUP: client has already seen this channel, or is not using this channel
* @DMA_NAK: client does not want to see any more channels
*/
enum dma_state_client {
DMA_ACK,
DMA_DUP,
DMA_NAK,
};
/** /**
* typedef dma_cookie_t - an opaque DMA cookie * typedef dma_cookie_t - an opaque DMA cookie
* *
@ -160,9 +148,10 @@ void dma_chan_cleanup(struct kref *kref);
* When this optional parameter is specified in a call to dma_request_channel a * When this optional parameter is specified in a call to dma_request_channel a
* suitable channel is passed to this routine for further dispositioning before * suitable channel is passed to this routine for further dispositioning before
* being returned. Where 'suitable' indicates a non-busy channel that * being returned. Where 'suitable' indicates a non-busy channel that
* satisfies the given capability mask. * satisfies the given capability mask. It returns 'true' to indicate that the
* channel is suitable.
*/ */
typedef enum dma_state_client (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
typedef void (*dma_async_tx_callback)(void *dma_async_param); typedef void (*dma_async_tx_callback)(void *dma_async_param);
/** /**