ソースを参照

thermal: exynos: Clean up non-DT remnants

Commit 1cd1ecb6 ("thermal: exynos: Remove non DT based support")
cleaned up some non-DT code. However, there were few more things
needed for complete cleanup to make this driver DT only.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Sachin Kamat 12 年 前
コミット
73b5b1d7c5
2 ファイル変更13 行追加19 行削除
  1. 1 1
      drivers/thermal/samsung/Kconfig
  2. 12 18
      drivers/thermal/samsung/exynos_tmu.c

+ 1 - 1
drivers/thermal/samsung/Kconfig

@@ -1,6 +1,6 @@
 config EXYNOS_THERMAL
 config EXYNOS_THERMAL
 	tristate "Exynos thermal management unit driver"
 	tristate "Exynos thermal management unit driver"
-	depends on ARCH_HAS_BANDGAP
+	depends on ARCH_HAS_BANDGAP && OF
 	help
 	help
 	  If you say yes here you get support for the TMU (Thermal Management
 	  If you say yes here you get support for the TMU (Thermal Management
 	  Unit) driver for SAMSUNG EXYNOS series of SoCs. This driver initialises
 	  Unit) driver for SAMSUNG EXYNOS series of SoCs. This driver initialises

+ 12 - 18
drivers/thermal/samsung/exynos_tmu.c

@@ -481,7 +481,6 @@ static irqreturn_t exynos_tmu_irq(int irq, void *id)
 	return IRQ_HANDLED;
 	return IRQ_HANDLED;
 }
 }
 
 
-#ifdef CONFIG_OF
 static const struct of_device_id exynos_tmu_match[] = {
 static const struct of_device_id exynos_tmu_match[] = {
 	{
 	{
 		.compatible = "samsung,exynos4210-tmu",
 		.compatible = "samsung,exynos4210-tmu",
@@ -502,27 +501,22 @@ static const struct of_device_id exynos_tmu_match[] = {
 	{},
 	{},
 };
 };
 MODULE_DEVICE_TABLE(of, exynos_tmu_match);
 MODULE_DEVICE_TABLE(of, exynos_tmu_match);
-#endif
 
 
 static inline struct  exynos_tmu_platform_data *exynos_get_driver_data(
 static inline struct  exynos_tmu_platform_data *exynos_get_driver_data(
 			struct platform_device *pdev, int id)
 			struct platform_device *pdev, int id)
 {
 {
-#ifdef CONFIG_OF
 	struct  exynos_tmu_init_data *data_table;
 	struct  exynos_tmu_init_data *data_table;
 	struct exynos_tmu_platform_data *tmu_data;
 	struct exynos_tmu_platform_data *tmu_data;
-	if (pdev->dev.of_node) {
-		const struct of_device_id *match;
-		match = of_match_node(exynos_tmu_match, pdev->dev.of_node);
-		if (!match)
-			return NULL;
-		data_table = (struct exynos_tmu_init_data *) match->data;
-		if (!data_table || id >= data_table->tmu_count)
-			return NULL;
-		tmu_data = data_table->tmu_data;
-		return (struct exynos_tmu_platform_data *) (tmu_data + id);
-	}
-#endif
-	return NULL;
+	const struct of_device_id *match;
+
+	match = of_match_node(exynos_tmu_match, pdev->dev.of_node);
+	if (!match)
+		return NULL;
+	data_table = (struct exynos_tmu_init_data *) match->data;
+	if (!data_table || id >= data_table->tmu_count)
+		return NULL;
+	tmu_data = data_table->tmu_data;
+	return (struct exynos_tmu_platform_data *) (tmu_data + id);
 }
 }
 
 
 static int exynos_map_dt_data(struct platform_device *pdev)
 static int exynos_map_dt_data(struct platform_device *pdev)
@@ -532,7 +526,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 	struct resource res;
 	struct resource res;
 	int ret;
 	int ret;
 
 
-	if (!data)
+	if (!data || !pdev->dev.of_node)
 		return -ENODEV;
 		return -ENODEV;
 
 
 	/*
 	/*
@@ -754,7 +748,7 @@ static struct platform_driver exynos_tmu_driver = {
 		.name   = "exynos-tmu",
 		.name   = "exynos-tmu",
 		.owner  = THIS_MODULE,
 		.owner  = THIS_MODULE,
 		.pm     = EXYNOS_TMU_PM,
 		.pm     = EXYNOS_TMU_PM,
-		.of_match_table = of_match_ptr(exynos_tmu_match),
+		.of_match_table = exynos_tmu_match,
 	},
 	},
 	.probe = exynos_tmu_probe,
 	.probe = exynos_tmu_probe,
 	.remove	= exynos_tmu_remove,
 	.remove	= exynos_tmu_remove,