| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <linux/slab.h> |
|---|
| 2 | 3 | #include <linux/kernel.h> |
|---|
| 3 | 4 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 97 | 98 | return 0; |
|---|
| 98 | 99 | } |
|---|
| 99 | 100 | |
|---|
| 100 | | -static int iio_read_first_n_kfifo(struct iio_buffer *r, |
|---|
| 101 | | - size_t n, char __user *buf) |
|---|
| 101 | +static int iio_read_kfifo(struct iio_buffer *r, size_t n, char __user *buf) |
|---|
| 102 | 102 | { |
|---|
| 103 | 103 | int ret, copied; |
|---|
| 104 | 104 | struct iio_kfifo *kf = iio_to_kfifo(r); |
|---|
| .. | .. |
|---|
| 140 | 140 | |
|---|
| 141 | 141 | static const struct iio_buffer_access_funcs kfifo_access_funcs = { |
|---|
| 142 | 142 | .store_to = &iio_store_to_kfifo, |
|---|
| 143 | | - .read_first_n = &iio_read_first_n_kfifo, |
|---|
| 143 | + .read = &iio_read_kfifo, |
|---|
| 144 | 144 | .data_available = iio_kfifo_buf_data_available, |
|---|
| 145 | 145 | .request_update = &iio_request_update_kfifo, |
|---|
| 146 | 146 | .set_bytes_per_datum = &iio_set_bytes_per_datum_kfifo, |
|---|
| .. | .. |
|---|
| 179 | 179 | iio_kfifo_free(*(struct iio_buffer **)res); |
|---|
| 180 | 180 | } |
|---|
| 181 | 181 | |
|---|
| 182 | | -static int devm_iio_kfifo_match(struct device *dev, void *res, void *data) |
|---|
| 183 | | -{ |
|---|
| 184 | | - struct iio_buffer **r = res; |
|---|
| 185 | | - |
|---|
| 186 | | - if (WARN_ON(!r || !*r)) |
|---|
| 187 | | - return 0; |
|---|
| 188 | | - |
|---|
| 189 | | - return *r == data; |
|---|
| 190 | | -} |
|---|
| 191 | | - |
|---|
| 192 | 182 | /** |
|---|
| 193 | 183 | * devm_iio_fifo_allocate - Resource-managed iio_kfifo_allocate() |
|---|
| 194 | 184 | * @dev: Device to allocate kfifo buffer for |
|---|
| .. | .. |
|---|
| 215 | 205 | return r; |
|---|
| 216 | 206 | } |
|---|
| 217 | 207 | EXPORT_SYMBOL(devm_iio_kfifo_allocate); |
|---|
| 218 | | - |
|---|
| 219 | | -/** |
|---|
| 220 | | - * devm_iio_fifo_free - Resource-managed iio_kfifo_free() |
|---|
| 221 | | - * @dev: Device the buffer belongs to |
|---|
| 222 | | - * @r: The buffer associated with the device |
|---|
| 223 | | - */ |
|---|
| 224 | | -void devm_iio_kfifo_free(struct device *dev, struct iio_buffer *r) |
|---|
| 225 | | -{ |
|---|
| 226 | | - WARN_ON(devres_release(dev, devm_iio_kfifo_release, |
|---|
| 227 | | - devm_iio_kfifo_match, r)); |
|---|
| 228 | | -} |
|---|
| 229 | | -EXPORT_SYMBOL(devm_iio_kfifo_free); |
|---|
| 230 | 208 | |
|---|
| 231 | 209 | MODULE_LICENSE("GPL"); |
|---|