Skip to contentSkip to conversation

media: staging/imx: do not return error in link_notify for unknown sources

PATCH New Steve Longerbeam 1 participant 1 message Oct 17, 2017

Subsystems (4)
lore
Share & tools
lore

Steve Longerbeam

author maintainer
#0 lore raw

PATCH v2 1/1 media: staging/imx: do not return error in link_notify for unknown sources

imx_media_link_notify() should not return error if the source subdevice of the link is not found in the list of subdevices that registered via async. If the subdev has controls they will be inherited via a link_notify that starts from a known source async subdev.

---
Changes since v1:
- expanded on commit message and comment.

---
 drivers/staging/media/imx/imx-media-dev.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/staging/media/imx/imx-media-dev.c +10 -2
index b55e5eb..809d92e 100644
@@ -508,8 +508,16 @@ static int imx_media_link_notify(struct media_link *link, u32 flags,
 	imxmd = dev_get_drvdata(sd->v4l2_dev->dev);
 
 	imxsd = imx_media_find_subdev_by_sd(imxmd, sd);
-	if (IS_ERR(imxsd))
-		return PTR_ERR(imxsd);
+	if (IS_ERR(imxsd)) {
+		/*
+		 * don't bother refreshing video device controls if the
+		 * source subdev isn't found in the async subdev list. If
+		 * this subdev has controls they will be inherited starting
+		 * from a known async subdev.
+		 */
+		return 0;
+	}
+
 	imxpad = &imxsd->pad[pad_idx];
 
 	/*
Signature · 1 line
2.7.4