[PATCH v2 03/16] media: i2c: ov2740: move remove() after the PM callbacks

From: Cong Nguyen

Date: Mon Nov 23 2026 - 10:39:59 EST


Move ov2740_remove() below the runtime PM callbacks so that the following
patch ("media: i2c: ov2740: power off the sensor on remove") can call
them from it without a forward declaration.

No functional change.

Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/media/i2c/ov2740.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
index 31513d1524a3..ca2ea5d4e0a3 100644
--- a/drivers/media/i2c/ov2740.c
+++ b/drivers/media/i2c/ov2740.c
@@ -1199,17 +1199,6 @@ static int ov2740_check_hwcfg(struct ov2740 *ov2740)
return ret;
}

-static void ov2740_remove(struct i2c_client *client)
-{
- struct v4l2_subdev *sd = i2c_get_clientdata(client);
-
- v4l2_async_unregister_subdev(sd);
- media_entity_cleanup(&sd->entity);
- v4l2_subdev_cleanup(sd);
- v4l2_ctrl_handler_free(sd->ctrl_handler);
- pm_runtime_disable(&client->dev);
-}
-
static int ov2740_nvmem_read(void *priv, unsigned int off, void *val,
size_t count)
{
@@ -1458,6 +1447,17 @@ static int ov2740_probe(struct i2c_client *client)
return ret;
}

+static void ov2740_remove(struct i2c_client *client)
+{
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+
+ v4l2_async_unregister_subdev(sd);
+ media_entity_cleanup(&sd->entity);
+ v4l2_subdev_cleanup(sd);
+ v4l2_ctrl_handler_free(sd->ctrl_handler);
+ pm_runtime_disable(&client->dev);
+}
+
static DEFINE_RUNTIME_DEV_PM_OPS(ov2740_pm_ops, ov2740_suspend, ov2740_resume,
NULL);

--
2.25.1