media: atomisp: Remove isp_subdev_link_setup()
authorHans de Goede <hdegoede@redhat.com>
Sun, 22 Jan 2023 19:59:23 +0000 (20:59 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 07:07:27 +0000 (08:07 +0100)
commit15b5128cafd5760c777945ec24cfadf45b6c1206
treefa2c2c9e2aa4ab2644937216b8cc73727a355ffd
parentcb90b196647282fc197804d680ad9d86889e27e4
media: atomisp: Remove isp_subdev_link_setup()

Looking at isp_subdev_link_setup(), this function can never work,
it does a switch-case like this:

 switch (local->index | is_media_entity_v4l2_subdev(remote->entity))

with cases like this:

 case ATOMISP_SUBDEV_PAD_SINK | MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN

where ATOMISP_SUBDEV_PAD_SINK matches an index (0-4) and
MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN is 0x00020000, but
is_media_entity_v4l2_subdev(remote->entity) does not return
MEDIA_ENT_F_* values, it return a bool, so 0 or 1 which means
that non of the cases can ever match the input value.

Looking at the rest of the function all it ever does (if it
would actually hit one of the cases) is set the atomisp_sub_device
struct's input member.

And checking the rest of the atomisp code that member is never
read. Also userspace does not actually setup media-controller
links when using the atomisp /dev/video$ nodes since all the links
are fixed. So isp_subdev_link_setup() never runs.

Remove the unnecessary and broken isp_subdev_link_setup() function
and also remove the unused atomisp_sub_device struct's input member.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_subdev.c
drivers/staging/media/atomisp/pci/atomisp_subdev.h