Hello Renaud, Thanks for the report and your investigation and sorry for the breakage.
I just Cc'd you on a suggested fix. Cheers, Ahmad On 15.07.25 17:04, Renaud Barbier wrote: > I have recently moved to barebox v2025.06 and the ethernet driver is failing > probing. > In the COMMIT below, dev_get_drvdata is replaced by the following function > device_get_match_data: > > const void *device_get_match_data(struct device *dev) > { > ~ if (dev->of_id_entry) { > + pr_err("%s A0 return 0x%p\n", __func__, > dev->of_id_entry->data); > return dev->of_id_entry->data; > + } > > ~ if (dev->id_entry) { > + pr_err("%s A1 return 0x%p\n", __func__, > dev->of_id_entry->data); > return (void *)dev->id_entry->driver_data; > + } > > + pr_err("%s return 0x%p\n", __func__, NULL); > return NULL; > } > > For my specific device, I get the following debug message: > ERROR: fsl-fman-port 1a8b000.p...@8b000.of: probe > ERROR: device_get_match_data A0 return 0x0000000000000000 (here > dev->of_id_entry is not NULL and dev->of_id_entry->data is returned) > > and from fsl_fman_port_probe: > ERROR: fsl-fman-port 1a8b000.p...@8b000.of: type = 0. This is a valid type: > FMAN_PORT_TYPE_RX = 0 > ERROR: fsl-fman-port 1a8b000.p...@8b000.of: out > > COMMIT: > index f205de1929..84e7f20330 100644 > --- a/drivers/net/fsl-fman.c > +++ b/drivers/net/fsl-fman.c > @@ -1085,15 +1085,14 @@ static int fsl_fman_mdio_probe(struct device *dev) > static int fsl_fman_port_probe(struct device *dev) > { > struct resource *iores; > - int ret; > struct fsl_fman_port *port; > unsigned long type; > > dev_dbg(dev, "probe\n"); > > - ret = dev_get_drvdata(dev, (const void **)&type); > dev_err(dev, "type = %d\n", type); <==== type is 0 or 1 > (FMAN_PORT_TYPE_RX or FMAN_PORT_TYPE_TX ) > - if (ret) > - return ret; > + type = (uintptr_t)device_get_match_data(dev); > + if (!type) <==== HERE it bails out because type == 0 > dev_err(dev, "out\n"); ** > + return -ENODEV; > > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |