Commit 621c88a3 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jakub Kicinski
Browse files

net: ti: am65-cpsw-nuss: Use syscon_regmap_lookup_by_phandle_args



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.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250112-syscon-phandle-args-net-v1-2-3423889935f7@linaro.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 136fff12
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -2569,20 +2569,15 @@ static int am65_cpsw_am654_get_efuse_macid(struct device_node *of_node,
{
	u32 mac_lo, mac_hi, offset;
	struct regmap *syscon;
	int ret;

	syscon = syscon_regmap_lookup_by_phandle(of_node, "ti,syscon-efuse");
	syscon = syscon_regmap_lookup_by_phandle_args(of_node, "ti,syscon-efuse",
						      1, &offset);
	if (IS_ERR(syscon)) {
		if (PTR_ERR(syscon) == -ENODEV)
			return 0;
		return PTR_ERR(syscon);
	}

	ret = of_property_read_u32_index(of_node, "ti,syscon-efuse", 1,
					 &offset);
	if (ret)
		return ret;

	regmap_read(syscon, offset, &mac_lo);
	regmap_read(syscon, offset + 4, &mac_hi);