]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: dm: skip scmi tests against disabled protocols
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 14 Nov 2023 02:14:24 +0000 (11:14 +0900)
committerTom Rini <trini@konsulko.com>
Wed, 29 Nov 2023 03:31:03 +0000 (22:31 -0500)
This is a precautionary change to make scmi tests workable whether or not
a specific protocol be enabled. If a given protocol is not configured,
we skip the test by returning -EAGAIN.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/dm/scmi.c

index da45314f2e4cf9d21981d0ce017b77162ae21157..582485471fff19fc90e001defb4874fca52f8b69 100644 (file)
@@ -217,6 +217,9 @@ static int dm_test_scmi_power_domains(struct unit_test_state *uts)
        u8 *name;
        int ret;
 
+       if (!CONFIG_IS_ENABLED(SCMI_POWER_DOMAIN))
+               return -EAGAIN;
+
        /* preparation */
        ut_assertok(load_sandbox_scmi_test_devices(uts, &agent, &dev));
        ut_assertnonnull(agent);
@@ -317,6 +320,9 @@ static int dm_test_scmi_clocks(struct unit_test_state *uts)
        int ret_dev;
        int ret;
 
+       if (!CONFIG_IS_ENABLED(CLK_SCMI))
+               return -EAGAIN;
+
        ret = load_sandbox_scmi_test_devices(uts, &agent, &dev);
        if (ret)
                return ret;
@@ -382,6 +388,9 @@ static int dm_test_scmi_resets(struct unit_test_state *uts)
        struct udevice *agent_dev, *reset_dev, *dev = NULL;
        int ret;
 
+       if (!CONFIG_IS_ENABLED(RESET_SCMI))
+               return -EAGAIN;
+
        ret = load_sandbox_scmi_test_devices(uts, &agent, &dev);
        if (ret)
                return ret;
@@ -418,6 +427,9 @@ static int dm_test_scmi_voltage_domains(struct unit_test_state *uts)
        struct udevice *dev;
        struct udevice *regul0_dev;
 
+       if (!CONFIG_IS_ENABLED(DM_REGULATOR_SCMI))
+               return -EAGAIN;
+
        ut_assertok(load_sandbox_scmi_test_devices(uts, &agent, &dev));
 
        scmi_devices = sandbox_scmi_devices_ctx(dev);