dmaengine: replace dma_async_client_register with dmaengine_get

Now that clients no longer need to be notified of channel arrival
dma_async_client_register can simply increment the dmaengine_ref_count.

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:17 -07:00
parent 74465b4ff9
commit 209b84a88f
4 changed files with 11 additions and 133 deletions

View File

@@ -600,10 +600,9 @@ static void dma_clients_notify_available(void)
}
/**
* dma_async_client_register - register a &dma_client
* @client: ptr to a client structure with valid 'event_callback' and 'cap_mask'
* dmaengine_get - register interest in dma_channels
*/
void dma_async_client_register(struct dma_client *client)
void dmaengine_get(void)
{
struct dma_device *device, *_d;
struct dma_chan *chan;
@@ -634,25 +633,18 @@ void dma_async_client_register(struct dma_client *client)
*/
if (dmaengine_ref_count == 1)
dma_channel_rebalance();
list_add_tail(&client->global_node, &dma_client_list);
mutex_unlock(&dma_list_mutex);
}
EXPORT_SYMBOL(dma_async_client_register);
EXPORT_SYMBOL(dmaengine_get);
/**
* dma_async_client_unregister - unregister a client and free the &dma_client
* @client: &dma_client to free
*
* Force frees any allocated DMA channels, frees the &dma_client memory
* dmaengine_put - let dma drivers be removed when ref_count == 0
*/
void dma_async_client_unregister(struct dma_client *client)
void dmaengine_put(void)
{
struct dma_device *device;
struct dma_chan *chan;
if (!client)
return;
mutex_lock(&dma_list_mutex);
dmaengine_ref_count--;
BUG_ON(dmaengine_ref_count < 0);
@@ -663,11 +655,9 @@ void dma_async_client_unregister(struct dma_client *client)
list_for_each_entry(chan, &device->channels, device_node)
dma_chan_put(chan);
}
list_del(&client->global_node);
mutex_unlock(&dma_list_mutex);
}
EXPORT_SYMBOL(dma_async_client_unregister);
EXPORT_SYMBOL(dmaengine_put);
/**
* dma_async_client_chan_request - send all available channels to the