hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/iio/buffer/kfifo_buf.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 #include <linux/slab.h>
23 #include <linux/kernel.h>
34 #include <linux/module.h>
....@@ -97,8 +98,7 @@
9798 return 0;
9899 }
99100
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)
102102 {
103103 int ret, copied;
104104 struct iio_kfifo *kf = iio_to_kfifo(r);
....@@ -140,7 +140,7 @@
140140
141141 static const struct iio_buffer_access_funcs kfifo_access_funcs = {
142142 .store_to = &iio_store_to_kfifo,
143
- .read_first_n = &iio_read_first_n_kfifo,
143
+ .read = &iio_read_kfifo,
144144 .data_available = iio_kfifo_buf_data_available,
145145 .request_update = &iio_request_update_kfifo,
146146 .set_bytes_per_datum = &iio_set_bytes_per_datum_kfifo,
....@@ -179,16 +179,6 @@
179179 iio_kfifo_free(*(struct iio_buffer **)res);
180180 }
181181
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
-
192182 /**
193183 * devm_iio_fifo_allocate - Resource-managed iio_kfifo_allocate()
194184 * @dev: Device to allocate kfifo buffer for
....@@ -215,17 +205,5 @@
215205 return r;
216206 }
217207 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);
230208
231209 MODULE_LICENSE("GPL");