soc: samsung: Use syscon_regmap_lookup_by_phandle_args
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sat, 11 Jan 2025 18:54:02 +0000 (19:54 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 3 Feb 2025 11:56:34 +0000 (12:56 +0100)
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

Link: https://lore.kernel.org/r/20250111185402.183793-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/soc/samsung/exynos-usi.c

index 114352695ac2bcb7c141b9ebbca89f28f2c3bcf3..1fda8d72f6873f8c2c86c7c5c4b61e34b990f077 100644 (file)
@@ -186,15 +186,11 @@ static int exynos_usi_parse_dt(struct device_node *np, struct exynos_usi *usi)
                return -EINVAL;
        usi->mode = mode;
 
-       usi->sysreg = syscon_regmap_lookup_by_phandle(np, "samsung,sysreg");
+       usi->sysreg = syscon_regmap_lookup_by_phandle_args(np, "samsung,sysreg",
+                                                          1, &usi->sw_conf);
        if (IS_ERR(usi->sysreg))
                return PTR_ERR(usi->sysreg);
 
-       ret = of_property_read_u32_index(np, "samsung,sysreg", 1,
-                                        &usi->sw_conf);
-       if (ret)
-               return ret;
-
        usi->clkreq_on = of_property_read_bool(np, "samsung,clkreq-on");
 
        return 0;