summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-05-18 15:19:14 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-06-09 14:59:16 +0100
commitf5e381ffb6fdd021f2a1c0172dce486f647746c6 (patch)
tree1b5423df37652f8a94be148001fe01fa8c960eba /drivers/staging
parent63558464ad4dc25dc012d67d5f1e9fad8abcc28a (diff)
downloadlinux-stable-f5e381ffb6fdd021f2a1c0172dce486f647746c6.tar.gz
linux-stable-f5e381ffb6fdd021f2a1c0172dce486f647746c6.tar.bz2
linux-stable-f5e381ffb6fdd021f2a1c0172dce486f647746c6.zip
media: atomisp: gc0310: Remove gc0310_s_config() function
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. Link: https://lore.kernel.org/r/20230518153214.194976-8-hdegoede@redhat.com Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/i2c/atomisp-gc0310.c20
1 files 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 b873621b3475..9051b10faab3 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 @@ error_unlock:
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)
{
@@ -406,7 +396,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;