Skip to content

Commit 9efc58d

Browse files
ryderlee1110Eduardo Valentin
authored andcommitted
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>
1 parent b43e3cf commit 9efc58d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/thermal/mtk_thermal.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,17 +677,14 @@ static int mtk_thermal_probe(struct platform_device *pdev)
677677
struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node;
678678
struct mtk_thermal *mt;
679679
struct resource *res;
680-
const struct of_device_id *of_id;
681680
u64 auxadc_phys_base, apmixed_phys_base;
682681
struct thermal_zone_device *tzdev;
683682

684683
mt = devm_kzalloc(&pdev->dev, sizeof(*mt), GFP_KERNEL);
685684
if (!mt)
686685
return -ENOMEM;
687686

688-
of_id = of_match_device(mtk_thermal_of_match, &pdev->dev);
689-
if (of_id)
690-
mt->conf = (const struct mtk_thermal_data *)of_id->data;
687+
mt->conf = of_device_get_match_data(&pdev->dev);
691688

692689
mt->clk_peri_therm = devm_clk_get(&pdev->dev, "therm");
693690
if (IS_ERR(mt->clk_peri_therm))

0 commit comments

Comments
 (0)