Linux Media Controller development
 help / color / mirror / Atom feed
From: Cong Nguyen <congnt264@gmail.com>
To: sakari.ailus@linux.intel.com
Cc: linux-media@vger.kernel.org, Cong Nguyen <congnt264@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 15/16] media: i2c: tc358746: move remove() after the PM callbacks
Date: Mon, 23 Nov 2026 22:39:26 +0700	[thread overview]
Message-ID: <20261123153927.2547169-16-congnt264@gmail.com> (raw)
In-Reply-To: <20261123153927.2547169-1-congnt264@gmail.com>

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@gmail.com>
---
 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


  parent reply	other threads:[~2026-11-23 15:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 15:39 [PATCH v2 00/16] media: i2c: power off the device in remove() Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 01/16] media: i2c: hi556: move remove() after the PM callbacks Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 02/16] media: i2c: hi556: power off the sensor on remove Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 03/16] media: i2c: ov2740: move remove() after the PM callbacks Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 04/16] media: i2c: ov2740: power off the sensor on remove Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 05/16] media: i2c: ak7375: move remove() after the PM callbacks Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 06/16] media: i2c: ak7375: power off the lens driver on remove Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 07/16] media: i2c: ov13b10: power off the sensor " Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 08/16] media: i2c: ov5670: do not power off twice " Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 09/16] media: i2c: ov8856: " Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 10/16] media: i2c: ov5648: power off the sensor " Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 11/16] media: i2c: ov8865: " Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 12/16] media: i2c: tw9900: power off the decoder " Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 13/16] media: i2c: isl7998x: move remove() after the PM callbacks Cong Nguyen
2026-11-23 15:39 ` [PATCH v2 14/16] media: i2c: isl7998x: power down the decoder on remove Cong Nguyen
2026-11-23 15:39 ` Cong Nguyen [this message]
2026-11-23 15:39 ` [PATCH v2 16/16] media: i2c: tc358746: power off the bridge " Cong Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123153927.2547169-16-congnt264@gmail.com \
    --to=congnt264@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox