industrialio-buffer.c (62f4f36cdfcdbb961bbbeab15e6595dd391d2205) | industrialio-buffer.c (b804e2b76ac6d5559b99588e0190ac97b5597497) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* The industrial I/O core 3 * 4 * Copyright (c) 2008 Jonathan Cameron 5 * 6 * Handling of buffer allocation / resizing. 7 * 8 * Things to look at here. --- 1136 unchanged lines hidden (view full) --- 1145 iio_free_scan_mask(indio_dev, new_config.scan_mask); 1146 return ret; 1147} 1148 1149int iio_update_buffers(struct iio_dev *indio_dev, 1150 struct iio_buffer *insert_buffer, 1151 struct iio_buffer *remove_buffer) 1152{ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* The industrial I/O core 3 * 4 * Copyright (c) 2008 Jonathan Cameron 5 * 6 * Handling of buffer allocation / resizing. 7 * 8 * Things to look at here. --- 1136 unchanged lines hidden (view full) --- 1145 iio_free_scan_mask(indio_dev, new_config.scan_mask); 1146 return ret; 1147} 1148 1149int iio_update_buffers(struct iio_dev *indio_dev, 1150 struct iio_buffer *insert_buffer, 1151 struct iio_buffer *remove_buffer) 1152{ |
1153 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); |
|
1153 int ret; 1154 1155 if (insert_buffer == remove_buffer) 1156 return 0; 1157 | 1154 int ret; 1155 1156 if (insert_buffer == remove_buffer) 1157 return 0; 1158 |
1158 mutex_lock(&indio_dev->info_exist_lock); | 1159 mutex_lock(&iio_dev_opaque->info_exist_lock); |
1159 mutex_lock(&indio_dev->mlock); 1160 1161 if (insert_buffer && iio_buffer_is_active(insert_buffer)) 1162 insert_buffer = NULL; 1163 1164 if (remove_buffer && !iio_buffer_is_active(remove_buffer)) 1165 remove_buffer = NULL; 1166 --- 6 unchanged lines hidden (view full) --- 1173 ret = -ENODEV; 1174 goto out_unlock; 1175 } 1176 1177 ret = __iio_update_buffers(indio_dev, insert_buffer, remove_buffer); 1178 1179out_unlock: 1180 mutex_unlock(&indio_dev->mlock); | 1160 mutex_lock(&indio_dev->mlock); 1161 1162 if (insert_buffer && iio_buffer_is_active(insert_buffer)) 1163 insert_buffer = NULL; 1164 1165 if (remove_buffer && !iio_buffer_is_active(remove_buffer)) 1166 remove_buffer = NULL; 1167 --- 6 unchanged lines hidden (view full) --- 1174 ret = -ENODEV; 1175 goto out_unlock; 1176 } 1177 1178 ret = __iio_update_buffers(indio_dev, insert_buffer, remove_buffer); 1179 1180out_unlock: 1181 mutex_unlock(&indio_dev->mlock); |
1181 mutex_unlock(&indio_dev->info_exist_lock); | 1182 mutex_unlock(&iio_dev_opaque->info_exist_lock); |
1182 1183 return ret; 1184} 1185EXPORT_SYMBOL_GPL(iio_update_buffers); 1186 1187void iio_disable_all_buffers(struct iio_dev *indio_dev) 1188{ 1189 iio_disable_buffers(indio_dev); --- 624 unchanged lines hidden --- | 1183 1184 return ret; 1185} 1186EXPORT_SYMBOL_GPL(iio_update_buffers); 1187 1188void iio_disable_all_buffers(struct iio_dev *indio_dev) 1189{ 1190 iio_disable_buffers(indio_dev); --- 624 unchanged lines hidden --- |