previous | start | next

Assigning Members of the file_operations struct

This syntax is permitted (in the 99 C standard) to assign device_read to the read member (and similarly for the other members) of the file_operations struct.

struct file_operations fops = {
    .read = device_read,
    .write = device_write,
    .open = device_open,
    .release = device_release
};

Members not explicitly assigned are given the value 0.



previous | start | next