Commit 2b5a90f0 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnode

Endpoint matching is now handled by the v4l2-core and drivers no longer
should set v4l2_subdev.fwnode to the endpoint fwnode.

Link: https://lore.kernel.org/r/20230812133628.355812-1-hdegoede@redhat.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 61d6b350
...@@ -83,7 +83,6 @@ struct gc0310_device { ...@@ -83,7 +83,6 @@ struct gc0310_device {
struct mutex input_lock; struct mutex input_lock;
bool is_streaming; bool is_streaming;
struct fwnode_handle *ep_fwnode;
struct gpio_desc *reset; struct gpio_desc *reset;
struct gpio_desc *powerdown; struct gpio_desc *powerdown;
...@@ -599,37 +598,37 @@ static void gc0310_remove(struct i2c_client *client) ...@@ -599,37 +598,37 @@ static void gc0310_remove(struct i2c_client *client)
media_entity_cleanup(&dev->sd.entity); media_entity_cleanup(&dev->sd.entity);
v4l2_ctrl_handler_free(&dev->ctrls.handler); v4l2_ctrl_handler_free(&dev->ctrls.handler);
mutex_destroy(&dev->input_lock); mutex_destroy(&dev->input_lock);
fwnode_handle_put(dev->ep_fwnode);
pm_runtime_disable(&client->dev); pm_runtime_disable(&client->dev);
} }
static int gc0310_probe(struct i2c_client *client) static int gc0310_probe(struct i2c_client *client)
{ {
struct fwnode_handle *ep_fwnode;
struct gc0310_device *dev; struct gc0310_device *dev;
int ret; int ret;
dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
/* /*
* Sometimes the fwnode graph is initialized by the bridge driver. * Sometimes the fwnode graph is initialized by the bridge driver.
* Bridge drivers doing this may also add GPIO mappings, wait for this. * Bridge drivers doing this may also add GPIO mappings, wait for this.
*/ */
dev->ep_fwnode = fwnode_graph_get_next_endpoint(dev_fwnode(&client->dev), NULL); ep_fwnode = fwnode_graph_get_next_endpoint(dev_fwnode(&client->dev), NULL);
if (!dev->ep_fwnode) if (!ep_fwnode)
return dev_err_probe(&client->dev, -EPROBE_DEFER, "waiting for fwnode graph endpoint\n"); return dev_err_probe(&client->dev, -EPROBE_DEFER, "waiting for fwnode graph endpoint\n");
fwnode_handle_put(ep_fwnode);
dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
dev->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH); dev->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dev->reset)) { if (IS_ERR(dev->reset)) {
fwnode_handle_put(dev->ep_fwnode);
return dev_err_probe(&client->dev, PTR_ERR(dev->reset), return dev_err_probe(&client->dev, PTR_ERR(dev->reset),
"getting reset GPIO\n"); "getting reset GPIO\n");
} }
dev->powerdown = devm_gpiod_get(&client->dev, "powerdown", GPIOD_OUT_HIGH); dev->powerdown = devm_gpiod_get(&client->dev, "powerdown", GPIOD_OUT_HIGH);
if (IS_ERR(dev->powerdown)) { if (IS_ERR(dev->powerdown)) {
fwnode_handle_put(dev->ep_fwnode);
return dev_err_probe(&client->dev, PTR_ERR(dev->powerdown), return dev_err_probe(&client->dev, PTR_ERR(dev->powerdown),
"getting powerdown GPIO\n"); "getting powerdown GPIO\n");
} }
...@@ -652,7 +651,6 @@ static int gc0310_probe(struct i2c_client *client) ...@@ -652,7 +651,6 @@ static int gc0310_probe(struct i2c_client *client)
dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
dev->pad.flags = MEDIA_PAD_FL_SOURCE; dev->pad.flags = MEDIA_PAD_FL_SOURCE;
dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
dev->sd.fwnode = dev->ep_fwnode;
ret = gc0310_init_controls(dev); ret = gc0310_init_controls(dev);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment