Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73692
b: refs/heads/master
c: 348badf
h: refs/heads/master
v: v3
  • Loading branch information
Haavard Skinnemoen authored and Linus Torvalds committed Nov 15, 2007
1 parent b8d2fc4 commit 18f0a11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90d8dabf74179e6615bd4688a118e12ec29ab7aa
refs/heads/master: 348badf1e825323c419dd118f65783db0f7d2ec8
17 changes: 6 additions & 11 deletions trunk/drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,9 @@ static void dma_client_chan_alloc(struct dma_client *client)
/* we are done once this client rejects
* an available resource
*/
if (ack == DMA_ACK) {
if (ack == DMA_ACK)
dma_chan_get(chan);
kref_get(&device->refcount);
} else if (ack == DMA_NAK)
else if (ack == DMA_NAK)
return;
}
}
Expand Down Expand Up @@ -272,11 +271,8 @@ static void dma_clients_notify_removed(struct dma_chan *chan)
/* client was holding resources for this channel so
* free it
*/
if (ack == DMA_ACK) {
if (ack == DMA_ACK)
dma_chan_put(chan);
kref_put(&chan->device->refcount,
dma_async_device_cleanup);
}
}

mutex_unlock(&dma_list_mutex);
Expand Down Expand Up @@ -316,11 +312,8 @@ void dma_async_client_unregister(struct dma_client *client)
ack = client->event_callback(client, chan,
DMA_RESOURCE_REMOVED);

if (ack == DMA_ACK) {
if (ack == DMA_ACK)
dma_chan_put(chan);
kref_put(&chan->device->refcount,
dma_async_device_cleanup);
}
}

list_del(&client->global_node);
Expand Down Expand Up @@ -397,6 +390,8 @@ int dma_async_device_register(struct dma_device *device)
goto err_out;
}

/* One for the channel, one of the class device */
kref_get(&device->refcount);
kref_get(&device->refcount);
kref_init(&chan->refcount);
chan->slow_ref = 0;
Expand Down

0 comments on commit 18f0a11

Please sign in to comment.