On 05/07/2018 05:46 PM, Mauro Carvalho Chehab wrote: > Em Fri, 4 May 2018 13:51:28 +0300 > Sakari Ailus <sakari.ailus@xxxxxx> escreveu: > >> On Thu, May 03, 2018 at 04:52:51PM +0200, Hans Verkuil wrote: >>> From: Hans Verkuil <hans.verkuil@xxxxxxxxx> >>> >>> The mdev field is only present if CONFIG_MEDIA_CONTROLLER is set. >>> But since we will need to pass the media_device to vb2 and the >>> control framework it is very convenient to just make this field >>> available all the time. If CONFIG_MEDIA_CONTROLLER is not set, >>> then it will just be NULL. >>> >>> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> >> >> Acked-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> >> > > This patch is no-brainer. It could be sent no matter what. However, > the patch is too simple :-) > > There are a number of places where if CONFIG_MEDIA_CONTROLLER > (and for CONFIG_MEDIA_CONTROLLER_DVB - with is also optionally > added at DVB core) is tested just because the field may or may > not be there. > > If we're willing to always have it at the struct, then we should look > on all #ifs for CONFIG_MEDIA_CONTROLLER and get rid of most (or all) > of them, ensuring that function stubs will be enough for the code > itself to do the right thing if !CONFIG_MEDIA_CONTROLLER. I looked at this, and in all cases where v4l2_dev->mdev is checked the following code always uses something that requires CONFIG_MEDIA_CONTROLLER anyway (usually the entity). Regards, Hans > > Thanks, > Mauro >