I am porting a v4l2 driver from kernel 4.4 to 4.9. In 4.4 kernel, we are using type and group_id for enumerating media entity. But group_id is obsolete in kernel 4.9. I want to have same user space code for both kernel versions.
Is there any way to identify kernel version at compile time or run time. I will prefer to have compile time check.
struct media_entity_desc This is same for both kernel versions, but on 4.9 group_id will always contains 0.
Thanks in advance.