Skip to contentSkip to conversation

i2c: designware: Remove dead code in AMD ISP case

PATCH Applied Andy Shevchenko 4 participants 4 messages Jan 29 – Feb 4

Subsystems (4)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

PATCH 1/1 i2c: designware: Remove dead code in AMD ISP case

The I²C bus shared with P-Unit is Intel only thing as far as I know. The AMD ISP driver has no relationship with P-Unit. Remove dead code that seems copied without much thinking.

---
 drivers/i2c/busses/i2c-designware-amdisp.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/i2c/busses/i2c-designware-amdisp.c +1 -12
index ec9259dd2a4f..c48728ad9f6f 100644
@@ -18,9 +18,6 @@
 static void amd_isp_dw_i2c_plat_pm_cleanup(struct dw_i2c_dev *i2c_dev)
 {
 	pm_runtime_disable(i2c_dev->dev);
-
-	if (i2c_dev->shared_with_punit)
-		pm_runtime_put_noidle(i2c_dev->dev);
 }
 
 static inline u32 amd_isp_dw_i2c_get_clk_rate(struct dw_i2c_dev *i2c_dev)
@@ -79,9 +76,6 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
 
 	device_enable_async_suspend(&pdev->dev);
 
-	if (isp_i2c_dev->shared_with_punit)
-		pm_runtime_get_noresume(&pdev->dev);
-
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 
@@ -130,9 +124,6 @@ static int amd_isp_dw_i2c_plat_runtime_suspend(struct device *dev)
 {
 	struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
 
-	if (i_dev->shared_with_punit)
-		return 0;
-
 	i2c_dw_disable(i_dev);
 	i2c_dw_prepare_clk(i_dev, false);
 
@@ -161,9 +152,7 @@ static int amd_isp_dw_i2c_plat_runtime_resume(struct device *dev)
 	if (!i_dev)
 		return -ENODEV;
 
-	if (!i_dev->shared_with_punit)
-		i2c_dw_prepare_clk(i_dev, true);
-
+	i2c_dw_prepare_clk(i_dev, true);
 	i2c_dw_init(i_dev);
 
 	return 0;
Signature · 1 line
2.50.1
Reviewed-by Pratap Nirujogi on v1 1/1
#2 lore raw
In reply to Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

The I²C bus shared with P-Unit is Intel only thing as far as I know. The AMD ISP driver has no relationship with P-Unit. Remove dead code that seems copied without much thinking.

---

Thanks Andy.

Quoted 51 lines
  drivers/i2c/busses/i2c-designware-amdisp.c | 13 +------------
  1 file changed, 1 insertion(+), 12 deletions(-)
drivers/i2c/busses/i2c-designware-amdisp.c +1 -13
index ec9259dd2a4f..c48728ad9f6f 100644
@@ -18,9 +18,6 @@
  static void amd_isp_dw_i2c_plat_pm_cleanup(struct dw_i2c_dev *i2c_dev)
  {
         pm_runtime_disable(i2c_dev->dev);
-
-       if (i2c_dev->shared_with_punit)
-               pm_runtime_put_noidle(i2c_dev->dev);
  }
 
  static inline u32 amd_isp_dw_i2c_get_clk_rate(struct dw_i2c_dev *i2c_dev)
@@ -79,9 +76,6 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
 
         device_enable_async_suspend(&pdev->dev);
 
-       if (isp_i2c_dev->shared_with_punit)
-               pm_runtime_get_noresume(&pdev->dev);
-
         pm_runtime_enable(&pdev->dev);
         pm_runtime_get_sync(&pdev->dev);
 
@@ -130,9 +124,6 @@ static int amd_isp_dw_i2c_plat_runtime_suspend(struct device *dev)
  {
         struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
 
-       if (i_dev->shared_with_punit)
-               return 0;
-
         i2c_dw_disable(i_dev);
         i2c_dw_prepare_clk(i_dev, false);
 
@@ -161,9 +152,7 @@ static int amd_isp_dw_i2c_plat_runtime_resume(struct device *dev)
         if (!i_dev)
                 return -ENODEV;
 
-       if (!i_dev->shared_with_punit)
-               i2c_dw_prepare_clk(i_dev, true);
-
+       i2c_dw_prepare_clk(i_dev, true);
         i2c_dw_init(i_dev);
 
         return 0;
--

2.50.1