[OpenWrt-Devel] [PATCH] ath79: use downstream ag71xx for Kernel 5.4

Petr Štetiar ynezz at true.cz
Fri Mar 13 08:29:26 EDT 2020


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

> David Bauer <mail at 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 at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list