]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: mediatek: mtk-dvfsrc: Change error check for DVFSRCv4 START cmd
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 24 Nov 2025 11:06:53 +0000 (12:06 +0100)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Thu, 8 Jan 2026 09:27:49 +0000 (10:27 +0100)
In preparation for adding support for DVFSRC Version 4, change the
error check for the MTK_SIP_DVFSRC_START command in the probe
function to error out only if BIT(0) is set: this is still valid
for the previous DVFSRC versions, as those always set this bit in
a fail reply anyway.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
drivers/soc/mediatek/mtk-dvfsrc.c

index 41add5636b03c073e833e229cd0005c8f61d22d6..7708b07ab2d6421b27009aff2950b3f994b4fa49 100644 (file)
@@ -440,7 +440,7 @@ static int mtk_dvfsrc_probe(struct platform_device *pdev)
        /* Everything is set up - make it run! */
        arm_smccc_smc(MTK_SIP_DVFSRC_VCOREFS_CONTROL, MTK_SIP_DVFSRC_START,
                      0, 0, 0, 0, 0, 0, &ares);
-       if (ares.a0)
+       if (ares.a0 & BIT(0))
                return dev_err_probe(&pdev->dev, -EINVAL, "Cannot start DVFSRC: %lu\n", ares.a0);
 
        return 0;