[PATCH v2 15/16] media: i2c: tc358746: move remove() after the PM callbacks
From: Cong Nguyen
Date: Mon Nov 23 2026 - 10:41:24 EST
Move tc358746_remove() below the runtime PM callbacks so that the following
patch ("media: i2c: tc358746: power off the bridge on remove") can call
them from it without a forward declaration.
No functional change.
Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/media/i2c/tc358746.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c
index 91d26a634023..88ff4a90eebc 100644
--- a/drivers/media/i2c/tc358746.c
+++ b/drivers/media/i2c/tc358746.c
@@ -1607,24 +1607,6 @@ static int tc358746_probe(struct i2c_client *client)
return err;
}
-static void tc358746_remove(struct i2c_client *client)
-{
- struct v4l2_subdev *sd = i2c_get_clientdata(client);
- struct tc358746 *tc358746 = to_tc358746(sd);
-
- v4l2_subdev_cleanup(sd);
- v4l2_ctrl_handler_free(&tc358746->ctrl_hdl);
- v4l2_fwnode_endpoint_free(&tc358746->csi_vep);
- v4l2_async_nf_unregister(&tc358746->notifier);
- v4l2_async_nf_cleanup(&tc358746->notifier);
- v4l2_async_unregister_subdev(sd);
- media_entity_cleanup(&sd->entity);
-
- pm_runtime_disable(sd->dev);
- pm_runtime_set_suspended(sd->dev);
- pm_runtime_dont_use_autosuspend(sd->dev);
-}
-
/*
* This function has been created just to avoid a smatch warning,
* please do not merge it into tc358746_suspend until you have
@@ -1692,6 +1674,24 @@ static int tc358746_resume(struct device *dev)
return err;
}
+static void tc358746_remove(struct i2c_client *client)
+{
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct tc358746 *tc358746 = to_tc358746(sd);
+
+ v4l2_subdev_cleanup(sd);
+ v4l2_ctrl_handler_free(&tc358746->ctrl_hdl);
+ v4l2_fwnode_endpoint_free(&tc358746->csi_vep);
+ v4l2_async_nf_unregister(&tc358746->notifier);
+ v4l2_async_nf_cleanup(&tc358746->notifier);
+ v4l2_async_unregister_subdev(sd);
+ media_entity_cleanup(&sd->entity);
+
+ pm_runtime_disable(sd->dev);
+ pm_runtime_set_suspended(sd->dev);
+ pm_runtime_dont_use_autosuspend(sd->dev);
+}
+
static DEFINE_RUNTIME_DEV_PM_OPS(tc358746_pm_ops, tc358746_suspend,
tc358746_resume, NULL);
--
2.25.1