From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Wed, 2 Dec 2015 14:51:04 +0100 Subject: [U-Boot] [PATCH v2 12/14] net: gem: Move driver to DM In-Reply-To: References: <3846048879467c3510abb54b930cdc05772d469e.1449056178.git.michal.simek@xilinx.com> Message-ID: <565EF748.2080206@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2.12.2015 14:16, Bin Meng wrote: > Hi Michal, > > On Wed, Dec 2, 2015 at 7:36 PM, Michal Simek wrote: ... >> + >> + offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset, >> + "phy-handle"); >> + if (offset > 0) >> + priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", 0); > > I don't see where is this priv->phyaddr used in this driver? phy_detection function called from zynq_phy_init/ > >> >> - return 1; >> + printf("ZYNQ GEM: %lx, phyaddr %d\n", (ulong)priv->iobase, >> + priv->phyaddr); >> + >> + return 0; >> } >> + >> +static const struct udevice_id zynq_gem_ids[] = { >> + { .compatible = "cdns,zynqmp-gem" }, >> + { .compatible = "cdns,zynq-gem" }, >> + { .compatible = "cdns,gem" }, >> + { } >> +}; >> + >> +U_BOOT_DRIVER(zynq_gem) = { >> + .name = "zynq_gem", >> + .id = UCLASS_ETH, >> + .of_match = zynq_gem_ids, >> + .ofdata_to_platdata = zynq_gem_ofdata_to_platdata, >> + .probe = zynq_gem_probe, > > Please add .remove function, otherwise there will be memory leak when > removing the device. See designware.c for example. No problem to do it. It will be almost c&p from that driver. Do we have any way how to detect these leaks? I have never tried to remove devices. How to do it? Thanks, Michal