mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 03:01:41 +02:00
net: stmmac: imx: 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. There is also no real benefit in printing errors on missing syscon argument, because this is done just too late: runtime check on static/build-time data. Dtschema and Devicetree bindings offer the static/build-time check for this already. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250112-syscon-phandle-args-net-v1-3-3423889935f7@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
621c88a392
commit
1e38b398b6
|
|
@ -302,15 +302,11 @@ imx_dwmac_parse_dt(struct imx_priv_data *dwmac, struct device *dev)
|
|||
* is required by i.MX8MP, i.MX93.
|
||||
* is optinoal for i.MX8DXL.
|
||||
*/
|
||||
dwmac->intf_regmap = syscon_regmap_lookup_by_phandle(np, "intf_mode");
|
||||
dwmac->intf_regmap =
|
||||
syscon_regmap_lookup_by_phandle_args(np, "intf_mode", 1,
|
||||
&dwmac->intf_reg_off);
|
||||
if (IS_ERR(dwmac->intf_regmap))
|
||||
return PTR_ERR(dwmac->intf_regmap);
|
||||
|
||||
err = of_property_read_u32_index(np, "intf_mode", 1, &dwmac->intf_reg_off);
|
||||
if (err) {
|
||||
dev_err(dev, "Can't get intf mode reg offset (%d)\n", err);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user