media: i2c: ds90ub9x3: Fix sub-device matching
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 31 Jul 2023 13:24:35 +0000 (16:24 +0300)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 10 Aug 2023 05:58:37 +0000 (07:58 +0200)
Commit 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode
matching") recently changed how async sub-device matching works. This
breaks the UB9x3 drivers, as they set the subdev.fwnode to an endpoint.
Afaiu, the fix is simply to not set subdev.fwnode at all.

Fixes: 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode matching")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/ds90ub913.c
drivers/media/i2c/ds90ub953.c

index 80d9cf6..5410ccb 100644 (file)
@@ -749,19 +749,9 @@ static int ub913_subdev_init(struct ub913_data *priv)
        if (ret)
                return dev_err_probe(dev, ret, "Failed to init pads\n");
 
-       priv->sd.fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev),
-                                                         UB913_PAD_SOURCE, 0,
-                                                         0);
-
-       if (!priv->sd.fwnode) {
-               ret = -ENODEV;
-               dev_err_probe(dev, ret, "Missing TX endpoint\n");
-               goto err_entity_cleanup;
-       }
-
        ret = v4l2_subdev_init_finalize(&priv->sd);
        if (ret)
-               goto err_fwnode_put;
+               goto err_entity_cleanup;
 
        ret = ub913_v4l2_notifier_register(priv);
        if (ret) {
@@ -782,8 +772,6 @@ err_unreg_notif:
        ub913_v4l2_nf_unregister(priv);
 err_subdev_cleanup:
        v4l2_subdev_cleanup(&priv->sd);
-err_fwnode_put:
-       fwnode_handle_put(priv->sd.fwnode);
 err_entity_cleanup:
        media_entity_cleanup(&priv->sd.entity);
 
index cadf75e..20b9cf8 100644 (file)
@@ -1221,18 +1221,9 @@ static int ub953_subdev_init(struct ub953_data *priv)
        if (ret)
                return dev_err_probe(dev, ret, "Failed to init pads\n");
 
-       priv->sd.fwnode = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev),
-                                                         UB953_PAD_SOURCE, 0,
-                                                         0);
-       if (!priv->sd.fwnode) {
-               ret = -ENODEV;
-               dev_err_probe(dev, ret, "Missing TX endpoint\n");
-               goto err_entity_cleanup;
-       }
-
        ret = v4l2_subdev_init_finalize(&priv->sd);
        if (ret)
-               goto err_fwnode_put;
+               goto err_entity_cleanup;
 
        ret = ub953_v4l2_notifier_register(priv);
        if (ret) {
@@ -1253,8 +1244,6 @@ err_unreg_notif:
        ub953_v4l2_notifier_unregister(priv);
 err_free_state:
        v4l2_subdev_cleanup(&priv->sd);
-err_fwnode_put:
-       fwnode_handle_put(priv->sd.fwnode);
 err_entity_cleanup:
        media_entity_cleanup(&priv->sd.entity);