[PATCH 21/22] drivers: platform: remove is_sh_early_platform_device

Christoph Hellwig hch at lst.de
Fri Jan 13 07:23:38 CET 2023


This was used as a hack for sh-architecture device initialization, and
with sh gone now, only the stub that always returns 0 is left.

Signed-off-by: Christoph Hellwig <hch at lst.de>
---
 drivers/clocksource/sh_cmt.c    |  8 ++------
 drivers/clocksource/sh_mtu2.c   |  8 ++------
 drivers/clocksource/sh_tmu.c    |  9 ++-------
 include/linux/platform_device.h | 12 ------------
 4 files changed, 6 insertions(+), 31 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 7fed3529bbaf82..4f6d7d40c9fcb1 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -1109,10 +1109,8 @@ static int sh_cmt_probe(struct platform_device *pdev)
 	struct sh_cmt_device *cmt = platform_get_drvdata(pdev);
 	int ret;
 
-	if (!is_sh_early_platform_device(pdev)) {
-		pm_runtime_set_active(&pdev->dev);
-		pm_runtime_enable(&pdev->dev);
-	}
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
 
 	if (cmt) {
 		dev_info(&pdev->dev, "kept as earlytimer\n");
@@ -1129,8 +1127,6 @@ static int sh_cmt_probe(struct platform_device *pdev)
 		pm_runtime_idle(&pdev->dev);
 		return ret;
 	}
-	if (is_sh_early_platform_device(pdev))
-		return 0;
 
  out:
 	if (cmt->has_clockevent || cmt->has_clocksource)
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
index e81e978513f80e..97ac2929e424be 100644
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -448,10 +448,8 @@ static int sh_mtu2_probe(struct platform_device *pdev)
 	struct sh_mtu2_device *mtu = platform_get_drvdata(pdev);
 	int ret;
 
-	if (!is_sh_early_platform_device(pdev)) {
-		pm_runtime_set_active(&pdev->dev);
-		pm_runtime_enable(&pdev->dev);
-	}
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
 
 	if (mtu) {
 		dev_info(&pdev->dev, "kept as earlytimer\n");
@@ -468,8 +466,6 @@ static int sh_mtu2_probe(struct platform_device *pdev)
 		pm_runtime_idle(&pdev->dev);
 		return ret;
 	}
-	if (is_sh_early_platform_device(pdev))
-		return 0;
 
  out:
 	if (mtu->has_clockevent)
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 596e9146ad54e9..940378d38dd523 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -595,10 +595,8 @@ static int sh_tmu_probe(struct platform_device *pdev)
 	struct sh_tmu_device *tmu = platform_get_drvdata(pdev);
 	int ret;
 
-	if (!is_sh_early_platform_device(pdev)) {
-		pm_runtime_set_active(&pdev->dev);
-		pm_runtime_enable(&pdev->dev);
-	}
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
 
 	if (tmu) {
 		dev_info(&pdev->dev, "kept as earlytimer\n");
@@ -616,9 +614,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	if (is_sh_early_platform_device(pdev))
-		return 0;
-
  out:
 	if (tmu->has_clockevent || tmu->has_clocksource)
 		pm_runtime_irq_safe(&pdev->dev);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index b0d5a253156ece..894939a74dd20f 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -352,18 +352,6 @@ extern int platform_pm_restore(struct device *dev);
 #define USE_PLATFORM_PM_SLEEP_OPS
 #endif
 
-#ifndef CONFIG_SUPERH
-/*
- * REVISIT: This stub is needed for all non-SuperH users of early platform
- * drivers. It should go away once we introduce the new platform_device-based
- * early driver framework.
- */
-static inline int is_sh_early_platform_device(struct platform_device *pdev)
-{
-	return 0;
-}
-#endif /* CONFIG_SUPERH */
-
 /* For now only SuperH uses it */
 void early_platform_cleanup(void);
 
-- 
2.39.0



More information about the Alsa-devel mailing list