Skip to content

Commit c46f16f

Browse files
Ondrej JirmanHans Verkuil
authored andcommitted
media: i2c: ov8858: Don't set fwnode in the driver
This makes the driver work with the new check in v4l2_async_register_subdev() that was introduced recently in 6.6-rc1. Without this change, probe fails with: ov8858 1-0036: Detected OV8858 sensor, revision 0xb2 ov8858 1-0036: sub-device fwnode is an endpoint! ov8858 1-0036: v4l2 async register subdev failed ov8858: probe of 1-0036 failed with error -22 This also simplifies the driver a bit. Signed-off-by: Ondrej Jirman <megi@xff.cz> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 1d4c258 commit c46f16f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/media/i2c/ov8858.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,9 +1850,9 @@ static int ov8858_parse_of(struct ov8858 *ov8858)
18501850
}
18511851

18521852
ret = v4l2_fwnode_endpoint_parse(endpoint, &vep);
1853+
fwnode_handle_put(endpoint);
18531854
if (ret) {
18541855
dev_err(dev, "Failed to parse endpoint: %d\n", ret);
1855-
fwnode_handle_put(endpoint);
18561856
return ret;
18571857
}
18581858

@@ -1864,12 +1864,9 @@ static int ov8858_parse_of(struct ov8858 *ov8858)
18641864
default:
18651865
dev_err(dev, "Unsupported number of data lanes %u\n",
18661866
ov8858->num_lanes);
1867-
fwnode_handle_put(endpoint);
18681867
return -EINVAL;
18691868
}
18701869

1871-
ov8858->subdev.fwnode = endpoint;
1872-
18731870
return 0;
18741871
}
18751872

@@ -1913,7 +1910,7 @@ static int ov8858_probe(struct i2c_client *client)
19131910

19141911
ret = ov8858_init_ctrls(ov8858);
19151912
if (ret)
1916-
goto err_put_fwnode;
1913+
return ret;
19171914

19181915
sd = &ov8858->subdev;
19191916
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
@@ -1964,8 +1961,6 @@ static int ov8858_probe(struct i2c_client *client)
19641961
media_entity_cleanup(&sd->entity);
19651962
err_free_handler:
19661963
v4l2_ctrl_handler_free(&ov8858->ctrl_handler);
1967-
err_put_fwnode:
1968-
fwnode_handle_put(ov8858->subdev.fwnode);
19691964

19701965
return ret;
19711966
}
@@ -1978,7 +1973,6 @@ static void ov8858_remove(struct i2c_client *client)
19781973
v4l2_async_unregister_subdev(sd);
19791974
media_entity_cleanup(&sd->entity);
19801975
v4l2_ctrl_handler_free(&ov8858->ctrl_handler);
1981-
fwnode_handle_put(ov8858->subdev.fwnode);
19821976

19831977
pm_runtime_disable(&client->dev);
19841978
if (!pm_runtime_status_suspended(&client->dev))

0 commit comments

Comments
 (0)