Bjørn Mork <bj...@mork.no> [2020-03-13 09:29:49]:

> David Bauer <m...@david-bauer.net> writes:
> 
> > --- 
> > a/target/linux/ath79/files-4.19/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
> > +++ 
> > b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
> > @@ -1581,7 +1581,7 @@ static int ag71xx_probe(struct platform_device *pdev)
> >     ag->stop_desc->next = (u32) ag->stop_desc_dma;
> >  
> >     mac_addr = of_get_mac_address(np);
> > -   if (mac_addr)
> > +   if (mac_addr && !IS_ERR(mac_addr))
> 
> bikeshedding...
Not bikeshedding at all, good catch. It's an issue which should be fixed.

It should be just `if (!IS_ERR(mac_addr))` because it's either valid pointer
or ERR_PTR since 5.2 via commit d01f449c008a ("of_net: add NVMEM support to
of_get_mac_address"). I would simply copy&paste the fragment from upstream
ag71xx.c.

681-NET-add-of_get_mac_address_mtd.patch needs to be updated for 5.4, that
of_get_mac_address_mtd() shouldn't return NULL, but ERR_PTR instead.

-- ynezz

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to