Make setting chunk_size and buffer_size mandatory for drivers which expect lirc_dev to allocate the lirc_buffer (i.e. ir-lirc-codec) and don't set them in lirc-zilog (which creates its own buffer). Also remove an unnecessary copy of chunk_size in struct irctl (the same information is already available from struct lirc_buffer).
Showing the changes to include/media/lirc_dev.h (1 of 3 files). Show all
Unified · Split
| @@ -121,13 +121,14 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, · 120 unmodified lines | ||
| 121 | 121 | * |
| 122 | 122 | * @code_length: length of the remote control key code expressed in bits. |
| 123 | 123 | * |
| 124 | − * @buffer_size: Number of FIFO buffers with @chunk_size size. If zero, | |
| 125 | − * creates a buffer with BUFLEN size (16 bytes). | |
| 126 | − * | |
| 127 | 124 | * @features: lirc compatible hardware features, like LIRC_MODE_RAW, |
| 128 | 125 | * LIRC_CAN\_\*, as defined at include/media/lirc.h. |
| 129 | 126 | * |
| 127 | + * @buffer_size: Number of FIFO buffers with @chunk_size size. | |
| 128 | + * Only used if @rbuf is NULL. | |
| 129 | + * | |
| 130 | 130 | * @chunk_size: Size of each FIFO buffer. |
| 131 | + * Only used if @rbuf is NULL. | |
| 131 | 132 | * |
| 132 | 133 | * @data: it may point to any driver data and this pointer will |
| 133 | 134 | * be passed to all callback functions. |
| @@ -162,9 +163,9 @@ struct lirc_driver { · 28 unmodified lines | ||
| 162 | 163 | char name[40]; |
| 163 | 164 | unsigned int minor; |
| 164 | 165 | __u32 code_length; |
| 165 | − unsigned int buffer_size; /* in chunks holding one code each */ | |
| 166 | 166 | __u32 features; |
| 167 | 167 | |
| 168 | + unsigned int buffer_size; /* in chunks holding one code each */ | |
| 168 | 169 | unsigned int chunk_size; |
| 169 | 170 | |
| 170 | 171 | void *data; |