aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyder Lee <ryder.lee@mediatek.com>2018-04-15 22:34:16 -0400
committerEduardo Valentin <edubezval@gmail.com>2018-05-06 19:53:47 -0400
commit9efc58dfa14a200efd5c005dd25ca95c686c1d8a (patch)
tree410249454a2737e50e2923f16cad31d5c7964344
parentb43e3cfe232ab01f7cf1f60179a1d005f62d6cc0 (diff)
thermal: mediatek: use of_device_get_match_data()
The usage of of_device_get_match_data() reduce the code size a bit. Also, the only way to call mtk_thermal_probe() is to match an entry in mtk_thermal_of_match[], so of_id cannot be NULL. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/mtk_thermal.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
index e709acb2235e..0691f260f6ea 100644
--- a/drivers/thermal/mtk_thermal.c
+++ b/drivers/thermal/mtk_thermal.c
@@ -677,7 +677,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
677 struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node; 677 struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node;
678 struct mtk_thermal *mt; 678 struct mtk_thermal *mt;
679 struct resource *res; 679 struct resource *res;
680 const struct of_device_id *of_id;
681 u64 auxadc_phys_base, apmixed_phys_base; 680 u64 auxadc_phys_base, apmixed_phys_base;
682 struct thermal_zone_device *tzdev; 681 struct thermal_zone_device *tzdev;
683 682
@@ -685,9 +684,7 @@ static int mtk_thermal_probe(struct platform_device *pdev)
685 if (!mt) 684 if (!mt)
686 return -ENOMEM; 685 return -ENOMEM;
687 686
688 of_id = of_match_device(mtk_thermal_of_match, &pdev->dev); 687 mt->conf = of_device_get_match_data(&pdev->dev);
689 if (of_id)
690 mt->conf = (const struct mtk_thermal_data *)of_id->data;
691 688
692 mt->clk_peri_therm = devm_clk_get(&pdev->dev, "therm"); 689 mt->clk_peri_therm = devm_clk_get(&pdev->dev, "therm");
693 if (IS_ERR(mt->clk_peri_therm)) 690 if (IS_ERR(mt->clk_peri_therm))