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

From: Cong Nguyen

Date: Mon Nov 23 2026 - 10:40:12 EST


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

No functional change.

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

diff --git a/drivers/media/i2c/ak7375.c b/drivers/media/i2c/ak7375.c
index 1ece5708b4b2..2827fdb29298 100644
--- a/drivers/media/i2c/ak7375.c
+++ b/drivers/media/i2c/ak7375.c
@@ -228,16 +228,6 @@ static int ak7375_probe(struct i2c_client *client)
return ret;
}

-static void ak7375_remove(struct i2c_client *client)
-{
- struct v4l2_subdev *sd = i2c_get_clientdata(client);
- struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd);
-
- ak7375_subdev_cleanup(ak7375_dev);
- pm_runtime_disable(&client->dev);
- pm_runtime_set_suspended(&client->dev);
-}
-
/*
* This function sets the vcm position, so it consumes least current
* The lens position is gradually moved in units of ctrl_steps,
@@ -334,6 +324,16 @@ static const struct of_device_id ak7375_of_table[] = {
};
MODULE_DEVICE_TABLE(of, ak7375_of_table);

+static void ak7375_remove(struct i2c_client *client)
+{
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct ak7375_device *ak7375_dev = sd_to_ak7375_vcm(sd);
+
+ ak7375_subdev_cleanup(ak7375_dev);
+ pm_runtime_disable(&client->dev);
+ pm_runtime_set_suspended(&client->dev);
+}
+
static const struct dev_pm_ops ak7375_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(ak7375_vcm_suspend, ak7375_vcm_resume)
SET_RUNTIME_PM_OPS(ak7375_vcm_suspend, ak7375_vcm_resume, NULL)
--
2.25.1