media: i2c: adv748x: Register only enabled inputs
authorJacopo Mondi <jacopo+renesas@jmondi.org>
Mon, 17 Sep 2018 11:30:57 +0000 (07:30 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 4 Oct 2018 18:50:44 +0000 (14:50 -0400)
commit1e2cb06f2ae7011b1bb8a9e74fb0884ae3b07a59
tree3376d931d7feac92bd718759b749ade2df4c075b
parenta7f9d21e9e96dea2e41d82e08ea2a55afdadd741
media: i2c: adv748x: Register only enabled inputs

The adv748x assumes input endpoints are always enabled, and registers
a subdevice for each of them when the corresponding output subdevice
is registered.

Fix this by conditionally registering the input subdevice only if it is
actually described in device tree.

Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/adv748x/adv748x-csi2.c
drivers/media/i2c/adv748x/adv748x.h