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

From: Cong Nguyen

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


Move hi556_remove() below the runtime PM callbacks so that the following
patch ("media: i2c: hi556: 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/hi556.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/media/i2c/hi556.c b/drivers/media/i2c/hi556.c
index 3b725bc59057..a151bab26821 100644
--- a/drivers/media/i2c/hi556.c
+++ b/drivers/media/i2c/hi556.c
@@ -1266,18 +1266,6 @@ static int hi556_check_hwcfg(struct device *dev)
return ret;
}

-static void hi556_remove(struct i2c_client *client)
-{
- struct v4l2_subdev *sd = i2c_get_clientdata(client);
- struct hi556 *hi556 = to_hi556(sd);
-
- v4l2_async_unregister_subdev(sd);
- media_entity_cleanup(&sd->entity);
- v4l2_ctrl_handler_free(sd->ctrl_handler);
- pm_runtime_disable(hi556->dev);
- mutex_destroy(&hi556->mutex);
-}
-
static int hi556_suspend(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
@@ -1427,6 +1415,18 @@ static int hi556_probe(struct i2c_client *client)
return ret;
}

+static void hi556_remove(struct i2c_client *client)
+{
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct hi556 *hi556 = to_hi556(sd);
+
+ v4l2_async_unregister_subdev(sd);
+ media_entity_cleanup(&sd->entity);
+ v4l2_ctrl_handler_free(sd->ctrl_handler);
+ pm_runtime_disable(hi556->dev);
+ mutex_destroy(&hi556->mutex);
+}
+
static DEFINE_RUNTIME_DEV_PM_OPS(hi556_pm_ops, hi556_suspend, hi556_resume,
NULL);

--
2.25.1