public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Andy Shevchenko <andy@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>, Kate Hsuan <hpa@redhat.com>,
	Tsuchiya Yuto <kitakar@gmail.com>,
	Yury Luneff <yury.lunev@gmail.com>,
	Nable <nable.maininbox@googlemail.com>,
	andrey.i.trufanov@gmail.com, Fabio Aiuto <fabioaiuto83@gmail.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH 7/9] media: atomisp: gc0310: Remove gc0310_s_config() function
Date: Thu, 18 May 2023 17:32:12 +0200	[thread overview]
Message-ID: <20230518153214.194976-8-hdegoede@redhat.com> (raw)
In-Reply-To: <20230518153214.194976-1-hdegoede@redhat.com>

gc0310_s_config() used to call camera_sensor_platform_data.csi_cfg() back
when the gc0310 driver was still using the atomisp_gmin_platform code
for power-management.

Now it is just a weirdly named wrapper around gc0310_detect(), drop
gc0310_s_config() and make probe() call gc0310_detect() directly.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 .../media/atomisp/i2c/atomisp-gc0310.c        | 20 +++++--------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index 35367d6efd2c..486ea7979c57 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -172,7 +172,10 @@ static int gc0310_detect(struct i2c_client *client)
 	if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
 		return -ENODEV;
 
-	ret = i2c_smbus_read_word_swapped(client, GC0310_SC_CMMN_CHIP_ID_H);
+	ret = pm_runtime_get_sync(&client->dev);
+	if (ret >= 0)
+		ret = i2c_smbus_read_word_swapped(client, GC0310_SC_CMMN_CHIP_ID_H);
+	pm_runtime_put(&client->dev);
 	if (ret < 0) {
 		dev_err(&client->dev, "read sensor_id failed: %d\n", ret);
 		return -ENODEV;
@@ -261,19 +264,6 @@ static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
 	return ret;
 }
 
-static int gc0310_s_config(struct v4l2_subdev *sd)
-{
-	struct i2c_client *client = v4l2_get_subdevdata(sd);
-	int ret;
-
-	ret = pm_runtime_get_sync(&client->dev);
-	if (ret >= 0)
-		ret = gc0310_detect(client);
-
-	pm_runtime_put(&client->dev);
-	return ret;
-}
-
 static int gc0310_g_frame_interval(struct v4l2_subdev *sd,
 				   struct v4l2_subdev_frame_interval *interval)
 {
@@ -403,7 +393,7 @@ static int gc0310_probe(struct i2c_client *client)
 	pm_runtime_set_autosuspend_delay(&client->dev, 1000);
 	pm_runtime_use_autosuspend(&client->dev);
 
-	ret = gc0310_s_config(&dev->sd);
+	ret = gc0310_detect(client);
 	if (ret) {
 		gc0310_remove(client);
 		return ret;
-- 
2.40.1


  parent reply	other threads:[~2023-05-18 15:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 15:32 [PATCH 0/9] media: v4l: Add v4l2_acpi_parse_sensor_gpios() helper + gc0310 sensor driver Hans de Goede
2023-05-18 15:32 ` [PATCH 1/9] media: v4l: Add v4l2_acpi_parse_sensor_gpios() helper function Hans de Goede
2023-05-18 16:36   ` Andy Shevchenko
2023-05-18 16:57     ` Hans de Goede
2023-05-19 10:19       ` Andy Shevchenko
2023-05-18 19:48   ` kernel test robot
2023-05-19  7:31   ` Sakari Ailus
2023-05-19  8:55     ` Hans de Goede
2023-05-19 10:21       ` Andy Shevchenko
2023-05-19 10:58       ` Sakari Ailus
2023-05-19 11:55         ` Hans de Goede
2023-05-19 12:16           ` Sakari Ailus
2023-05-19 13:08             ` Hans de Goede
2023-05-19 14:01               ` Sakari Ailus
2023-05-19 14:39                 ` Hans de Goede
2023-05-24 12:16                   ` Sakari Ailus
2023-05-18 15:32 ` [PATCH 2/9] media: atomisp: Switch to v4l2_acpi_parse_sensor_gpios() Hans de Goede
2023-05-18 15:32 ` [PATCH 3/9] media: atomisp: gc0310: Turn into standard v4l2 sensor driver Hans de Goede
2023-05-18 15:32 ` [PATCH 4/9] media: atomisp: gc0310: Drop XXGC0310 ACPI hardware-id Hans de Goede
2023-05-19 10:24   ` Andy Shevchenko
2023-05-18 15:32 ` [PATCH 5/9] media: atomisp: gc0310: Fix double free in gc0310_remove() Hans de Goede
2023-05-18 15:32 ` [PATCH 6/9] media: atomisp: gc0310: Cleanup includes Hans de Goede
2023-05-18 15:32 ` Hans de Goede [this message]
2023-05-19 10:32   ` [PATCH 7/9] media: atomisp: gc0310: Remove gc0310_s_config() function Andy Shevchenko
2023-05-19 10:35     ` Hans de Goede
2023-05-18 15:32 ` [PATCH 8/9] media: atomisp: gc0310: Remove gc0310.h Hans de Goede
2023-05-18 15:32 ` [PATCH 9/9] media: Move gc0310 sensor drivers to drivers/media/i2c/ Hans de Goede
2023-05-21  1:13   ` kernel test robot
2023-05-18 16:02 ` [PATCH 0/9] media: v4l: Add v4l2_acpi_parse_sensor_gpios() helper + gc0310 sensor driver Andy Shevchenko
2023-05-18 16:49   ` Hans de Goede
2023-05-19 12:14 ` Andy Shevchenko

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=20230518153214.194976-8-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andrey.i.trufanov@gmail.com \
    --cc=andy@kernel.org \
    --cc=fabioaiuto83@gmail.com \
    --cc=hpa@redhat.com \
    --cc=kitakar@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nable.maininbox@googlemail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yury.lunev@gmail.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