Commit 9efc58df authored by Ryder Lee's avatar Ryder Lee Committed by Eduardo Valentin

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: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent b43e3cfe
...@@ -677,7 +677,6 @@ static int mtk_thermal_probe(struct platform_device *pdev) ...@@ -677,7 +677,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node; struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node;
struct mtk_thermal *mt; struct mtk_thermal *mt;
struct resource *res; struct resource *res;
const struct of_device_id *of_id;
u64 auxadc_phys_base, apmixed_phys_base; u64 auxadc_phys_base, apmixed_phys_base;
struct thermal_zone_device *tzdev; struct thermal_zone_device *tzdev;
...@@ -685,9 +684,7 @@ static int mtk_thermal_probe(struct platform_device *pdev) ...@@ -685,9 +684,7 @@ static int mtk_thermal_probe(struct platform_device *pdev)
if (!mt) if (!mt)
return -ENOMEM; return -ENOMEM;
of_id = of_match_device(mtk_thermal_of_match, &pdev->dev); mt->conf = of_device_get_match_data(&pdev->dev);
if (of_id)
mt->conf = (const struct mtk_thermal_data *)of_id->data;
mt->clk_peri_therm = devm_clk_get(&pdev->dev, "therm"); mt->clk_peri_therm = devm_clk_get(&pdev->dev, "therm");
if (IS_ERR(mt->clk_peri_therm)) if (IS_ERR(mt->clk_peri_therm))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment