]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: imx283: Drop runtime suspend/resume functions
authorTarang Raval <tarang.raval@siliconsignals.io>
Mon, 24 Feb 2025 11:05:54 +0000 (16:35 +0530)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 4 Mar 2025 12:35:32 +0000 (13:35 +0100)
The imx283_runtime_suspend and imx283_runtime_resume functions
simply call imx283_power_off and imx283_power_on, respectively.
Since these functions do not add any additional logic, they are
unnecessary and can be removed.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/imx283.c

index f676faf4b301f6cefa045e833d131e67e4458145..beb9169f93ade3ae5c01d019a30514b041cae892 100644 (file)
@@ -1170,8 +1170,10 @@ static int imx283_disable_streams(struct v4l2_subdev *sd,
 }
 
 /* Power/clock management functions */
-static int imx283_power_on(struct imx283 *imx283)
+static int imx283_power_on(struct device *dev)
 {
+       struct v4l2_subdev *sd = dev_get_drvdata(dev);
+       struct imx283 *imx283 = to_imx283(sd);
        int ret;
 
        ret = regulator_bulk_enable(ARRAY_SIZE(imx283_supply_name),
@@ -1199,29 +1201,14 @@ reg_off:
        return ret;
 }
 
-static int imx283_power_off(struct imx283 *imx283)
-{
-       gpiod_set_value_cansleep(imx283->reset_gpio, 1);
-       regulator_bulk_disable(ARRAY_SIZE(imx283_supply_name), imx283->supplies);
-       clk_disable_unprepare(imx283->xclk);
-
-       return 0;
-}
-
-static int imx283_runtime_resume(struct device *dev)
+static int imx283_power_off(struct device *dev)
 {
        struct v4l2_subdev *sd = dev_get_drvdata(dev);
        struct imx283 *imx283 = to_imx283(sd);
 
-       return imx283_power_on(imx283);
-}
-
-static int imx283_runtime_suspend(struct device *dev)
-{
-       struct v4l2_subdev *sd = dev_get_drvdata(dev);
-       struct imx283 *imx283 = to_imx283(sd);
-
-       imx283_power_off(imx283);
+       gpiod_set_value_cansleep(imx283->reset_gpio, 1);
+       regulator_bulk_disable(ARRAY_SIZE(imx283_supply_name), imx283->supplies);
+       clk_disable_unprepare(imx283->xclk);
 
        return 0;
 }
@@ -1516,7 +1503,7 @@ static int imx283_probe(struct i2c_client *client)
         * The sensor must be powered for imx283_identify_module()
         * to be able to read the CHIP_ID register
         */
-       ret = imx283_power_on(imx283);
+       ret = imx283_power_on(imx283->dev);
        if (ret)
                return ret;
 
@@ -1589,7 +1576,7 @@ error_pm:
        pm_runtime_disable(imx283->dev);
        pm_runtime_set_suspended(imx283->dev);
 error_power_off:
-       imx283_power_off(imx283);
+       imx283_power_off(imx283->dev);
 
        return ret;
 }
@@ -1606,12 +1593,12 @@ static void imx283_remove(struct i2c_client *client)
 
        pm_runtime_disable(imx283->dev);
        if (!pm_runtime_status_suspended(imx283->dev))
-               imx283_power_off(imx283);
+               imx283_power_off(imx283->dev);
        pm_runtime_set_suspended(imx283->dev);
 }
 
-static DEFINE_RUNTIME_DEV_PM_OPS(imx283_pm_ops, imx283_runtime_suspend,
-                                imx283_runtime_resume, NULL);
+static DEFINE_RUNTIME_DEV_PM_OPS(imx283_pm_ops, imx283_power_off,
+                                imx283_power_on, NULL);
 
 static const struct of_device_id imx283_dt_ids[] = {
        { .compatible = "sony,imx283" },