Now that all the code that accesses the Comedi buffer data does so page-by-page, using the `virt_addr` member of `struct comedi_buf_page` to point to the data of each page, do not linearly map the buffer into vmalloc address space (pointed to by the `prealloc_buf` member of `struct comedi_async`). That was only done for convenience, but was not done for those drivers that need a DMA coherent buffer, which is allocated in a single chunk. Remove the `prealloc_buf` member as it is no longer used.
Showing the changes to include/linux/comedi (1 of 2 files). Show all
Unified · Split
| @@ -234,16 +234,12 @@ struct comedi_buf_page { · 233 unmodified lines | ||
| 234 | 234 | * |
| 235 | 235 | * A COMEDI data buffer is allocated as individual pages, either in |
| 236 | 236 | * conventional memory or DMA coherent memory, depending on the attached, |
| 237 | − * low-level hardware device. (The buffer pages also get mapped into the | |
| 238 | − * kernel's contiguous virtual address space pointed to by the 'prealloc_buf' | |
| 239 | − * member of &struct comedi_async.) | |
| 237 | + * low-level hardware device. | |
| 240 | 238 | * |
| 241 | 239 | * The buffer is normally freed when the COMEDI device is detached from the |
| 242 | 240 | * low-level driver (which may happen due to device removal), but if it happens |
| 243 | 241 | * to be mmapped at the time, the pages cannot be freed until the buffer has |
| 244 | − * been munmapped. That is what the reference counter is for. (The virtual | |
| 245 | − * address space pointed by 'prealloc_buf' is freed when the COMEDI device is | |
| 246 | − * detached.) | |
| 242 | + * been munmapped. That is what the reference counter is for. | |
| 247 | 243 | */ |
| 248 | 244 | struct comedi_buf_map { |
| 249 | 245 | struct device *dma_hw_dev; |
| @@ -255,7 +251,6 @@ struct comedi_buf_map { · 5 unmodified lines | ||
| 255 | 251 | |
| 256 | 252 | /** |
| 257 | 253 | * struct comedi_async - Control data for asynchronous COMEDI commands |
| 258 | − * @prealloc_buf: Kernel virtual address of allocated acquisition buffer. | |
| 259 | 254 | * @prealloc_bufsz: Buffer size (in bytes). |
| 260 | 255 | * @buf_map: Map of buffer pages. |
| 261 | 256 | * @max_bufsize: Maximum allowed buffer size (in bytes). |
| @@ -344,7 +339,6 @@ struct comedi_buf_map { · 82 unmodified lines | ||
| 344 | 339 | * less than or equal to UINT_MAX). |
| 345 | 340 | */ |
| 346 | 341 | struct comedi_async { |
| 347 | − void *prealloc_buf; | |
| 348 | 342 | unsigned int prealloc_bufsz; |
| 349 | 343 | struct comedi_buf_map *buf_map; |
| 350 | 344 | unsigned int max_bufsize; |