dmapool.c (c441bfb5f2866de71e092c1b9d866a65978dfe1a) dmapool.c (e8df2c703d5d1a99cfc45124bfa6f5e1982e0166)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * DMA Pool allocator
4 *
5 * Copyright 2001 David Brownell
6 * Copyright 2007 Intel Corporation
7 * Author: Matthew Wilcox <willy@linux.intel.com>
8 *

--- 48 unchanged lines hidden (view full) ---

57 dma_addr_t dma;
58 unsigned int in_use;
59 unsigned int offset;
60};
61
62static DEFINE_MUTEX(pools_lock);
63static DEFINE_MUTEX(pools_reg_lock);
64
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * DMA Pool allocator
4 *
5 * Copyright 2001 David Brownell
6 * Copyright 2007 Intel Corporation
7 * Author: Matthew Wilcox <willy@linux.intel.com>
8 *

--- 48 unchanged lines hidden (view full) ---

57 dma_addr_t dma;
58 unsigned int in_use;
59 unsigned int offset;
60};
61
62static DEFINE_MUTEX(pools_lock);
63static DEFINE_MUTEX(pools_reg_lock);
64
65static ssize_t
66show_pools(struct device *dev, struct device_attribute *attr, char *buf)
65static ssize_t pools_show(struct device *dev, struct device_attribute *attr, char *buf)
67{
68 unsigned temp;
69 unsigned size;
70 char *next;
71 struct dma_page *page;
72 struct dma_pool *pool;
73
74 next = buf;

--- 23 unchanged lines hidden (view full) ---

98 size -= temp;
99 next += temp;
100 }
101 mutex_unlock(&pools_lock);
102
103 return PAGE_SIZE - size;
104}
105
66{
67 unsigned temp;
68 unsigned size;
69 char *next;
70 struct dma_page *page;
71 struct dma_pool *pool;
72
73 next = buf;

--- 23 unchanged lines hidden (view full) ---

97 size -= temp;
98 next += temp;
99 }
100 mutex_unlock(&pools_lock);
101
102 return PAGE_SIZE - size;
103}
104
106static DEVICE_ATTR(pools, 0444, show_pools, NULL);
105static DEVICE_ATTR_RO(pools);
107
108/**
109 * dma_pool_create - Creates a pool of consistent memory blocks, for dma.
110 * @name: name of pool, for diagnostics
111 * @dev: device that will be doing the DMA
112 * @size: size of the blocks in this pool.
113 * @align: alignment requirement for blocks; must be a power of two
114 * @boundary: returned blocks won't cross this power of two boundary

--- 416 unchanged lines hidden ---
106
107/**
108 * dma_pool_create - Creates a pool of consistent memory blocks, for dma.
109 * @name: name of pool, for diagnostics
110 * @dev: device that will be doing the DMA
111 * @size: size of the blocks in this pool.
112 * @align: alignment requirement for blocks; must be a power of two
113 * @boundary: returned blocks won't cross this power of two boundary

--- 416 unchanged lines hidden ---