media: media.h: reorganize header to make it easier to understand
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 5 Feb 2018 11:19:00 +0000 (06:19 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 26 Feb 2018 15:14:46 +0000 (10:14 -0500)
commited3056f015de90a53127d05c34d49fe3e04675a4
tree9f68eaedeb28f4b426a512ff36509949a4d3e793
parent84694edcae195bd3b0dadd9df176a01ae5912621
media: media.h: reorganize header to make it easier to understand

The media.h public header is very messy. It mixes legacy and 'new' defines
and it is not easy to figure out what should and what shouldn't be used. It
also contains confusing comment that are either out of date or completely
uninteresting for anyone that needs to use this header.

The patch groups all entity functions together, including the 'old' defines
based on the old range base. The reader just wants to know about the available
functions and doesn't care about what range is used.

All legacy defines are moved to the end of the header, so it is easier to
locate them and just ignore them.

The legacy structs in the struct media_entity_desc are put under
also a much more effective signal to the reader that they shouldn't be used
compared to the old method of relying on '#if 1' followed by a comment.

The unused MEDIA_INTF_T_ALSA_* defines are also moved to the end of the header
in the legacy area. They are also dropped from intf_type() in media-entity.c.

All defines are also aligned at the same tab making the header easier to read.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[mchehab@s-opensource.com: removed lots of spaces before tabs; typo changes ->change ]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/media-entity.c
include/uapi/linux/media.h