Message ID | 20250112-syscon-phandle-args-net-v1-2-3423889935f7@linaro.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | net: ethernet: Simplify few things | expand |
On 12/01/25 7:02 pm, Krzysztof Kozlowski wrote: > 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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > --- > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > The patch only touches `drivers/net/ethernet/ti/am65-cpsw-nuss.c` however the subject suggests the patch is related to "icssg-prueth". I suppose the subject should be changed to "am65-cpsw-nuss" instead of "icssg-prueth"
On 13/01/2025 09:07, MD Danish Anwar wrote: > > > On 12/01/25 7:02 pm, Krzysztof Kozlowski wrote: >> 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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> --- >> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++------- >> 1 file changed, 2 insertions(+), 7 deletions(-) >> > > The patch only touches `drivers/net/ethernet/ti/am65-cpsw-nuss.c` > however the subject suggests the patch is related to "icssg-prueth". > > I suppose the subject should be changed to "am65-cpsw-nuss" instead of > "icssg-prueth" Indeed, copy paste. Best regards, Krzysztof
On Mon, 13 Jan 2025 12:04:35 +0100 Krzysztof Kozlowski wrote: > > The patch only touches `drivers/net/ethernet/ti/am65-cpsw-nuss.c` > > however the subject suggests the patch is related to "icssg-prueth". > > > > I suppose the subject should be changed to "am65-cpsw-nuss" instead of > > "icssg-prueth" > > Indeed, copy paste. Will fix when applying.
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 5465bf872734a3fb9e7e481d556eaec3cce30e0e..68f1136e3db725eba239b10f337786ac735030ca 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2559,20 +2559,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);
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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)