From nobody Thu Oct 9 04:43:24 2025 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D027221F28 for ; Thu, 19 Jun 2025 20:05:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363559; cv=none; b=i0UxERFFt838DIE6+AhLmyDb/2cvKGU+3MBKaTCcC+6VzsU69ue9olP62TsOweKNVDK1IWIiGN2Um3AxtSYR5xrkzCF0Hur7a1mClP6BIMfB48MOufh2nGWBt/RP3J7V0p1ZmqGCyoXgUUGCGZv2dxkR6rJ0mio7fpp1EvkdL4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363559; c=relaxed/simple; bh=dwsBTxlM2QohXlP1ErlyMOXw37DysFBS3JLvamLR6Do=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kA2ENh9Q0iDYdGqQSPBcdpEfSwxRXj0pQPTNqTMyKWlG7tAgBs0by532J4867uSppdgbJ6lMp3C2h+zuFf1l5QLDpd5XRuvdK077wl7+GksarcDiQu2O0knvwnW3S9tSZZFu1d8FcYx/GvOoVwIAkaTQSUQW61qI6nCQDMLcJLY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=U3ZaH+Oz; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="U3ZaH+Oz" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1750363555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F92lwo5VOd1tq612WPpWLZKza4VCHqS8IRTHLKoOjew=; b=U3ZaH+OzZC4XyFuiMwkaaxWeHokAzLwigVj+qnaoY7KwKzsbhxDlPd9M8QE9zWVgL4B7W6 VDb90LbN9ao6Bcooq/qxZv7OXqed103e2WAOvU/aODvZ6Ud6hWDD2BRTRlwyxS5LnWfxtl ZCcQxoxHJdj0HISri8DPdBgTf3rrDv8= From: Sean Anderson To: Radhey Shyam Pandey , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Greg Kroah-Hartman Cc: Michal Simek , Saravana Kannan , Leon Romanovsky , Dave Ertman , linux-kernel@vger.kernel.org, Ira Weiny , linux-arm-kernel@lists.infradead.org, Sean Anderson , Danilo Krummrich , "Rafael J. Wysocki" Subject: [PATCH net 1/4] auxiliary: Allow empty id Date: Thu, 19 Jun 2025 16:05:34 -0400 Message-Id: <20250619200537.260017-2-sean.anderson@linux.dev> In-Reply-To: <20250619200537.260017-1-sean.anderson@linux.dev> References: <20250619200537.260017-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Support creating auxiliary devices with the id included as part of the name. This allows for non-decimal ids, which may be more appropriate for auxiliary devices created as children of memory-mapped devices. For example, a name like "xilinx_emac.mac.802c0000" could be achieved by setting .name to "mac.802c0000" and .id to AUXILIARY_DEVID_NONE. Signed-off-by: Sean Anderson --- drivers/base/auxiliary.c | 6 +++++- include/linux/auxiliary_bus.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c index dba7c8e13a53..64a0d5e2eb83 100644 --- a/drivers/base/auxiliary.c +++ b/drivers/base/auxiliary.c @@ -331,7 +331,11 @@ int __auxiliary_device_add(struct auxiliary_device *au= xdev, const char *modname) return -EINVAL; } =20 - ret =3D dev_set_name(dev, "%s.%s.%d", modname, auxdev->name, auxdev->id); + if (auxdev->id =3D=3D AUXILIARY_DEVID_NONE) + ret =3D dev_set_name(dev, "%s.%s", modname, auxdev->name); + else + ret =3D dev_set_name(dev, "%s.%s.%d", modname, auxdev->name, + auxdev->id); if (ret) { dev_err(dev, "auxiliary device dev_set_name failed: %d\n", ret); return ret; diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h index 4086afd0cc6b..76904cf2c3dd 100644 --- a/include/linux/auxiliary_bus.h +++ b/include/linux/auxiliary_bus.h @@ -51,6 +51,8 @@ * unregisters the auxiliary device. */ =20 +#define AUXILIARY_DEVID_NONE (-1) + /** * struct auxiliary_device - auxiliary device object. * @dev: Device, @@ -269,7 +271,7 @@ struct auxiliary_device *__devm_auxiliary_device_create= (struct device *dev, =20 #define devm_auxiliary_device_create(dev, devname, platform_data) \ __devm_auxiliary_device_create(dev, KBUILD_MODNAME, devname, \ - platform_data, 0) + platform_data, AUXILIARY_DEVID_NONE) =20 /** * module_auxiliary_driver() - Helper macro for registering an auxiliary d= river --=20 2.35.1.1320.gc452695387.dirty From nobody Thu Oct 9 04:43:24 2025 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA92624679D for ; Thu, 19 Jun 2025 20:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363561; cv=none; b=s4AcUyEBZtfnehWuKC2ex8pX5W+Pw9pGd7DCMV4atxzg43ySLGd1VY2PcgWfJ0Wfsw/q2qcfcNJ/h9GPwYXXaLSaG5pxtFfTnDafFux+uV3hI+5SPZeC1YNUGEQ97XFEM0Pw0qlQOV5ztSj+3ts4HjtN2yZoUcUbU3sFff39mqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363561; c=relaxed/simple; bh=3QnpzpKHyRTRDm+k/OXOa/qIJLVPCzpI16UivuDPQoA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qi5cxqStDhNg/qs6u0aADp/S5KgdG3oTQTXqg6TmOVYcnlp2Ybkr/4mailIKMcXeKyQw4qOsgWWtp1nnSq4SUEnxHWGUHifOzhCiJ82crhw42drC+XCcxlLXZz9SSJS5393VaY0qz3GoeDVtgFxf/sBQWS+SMu6m3LwIo/fuI7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fOpPHc6I; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fOpPHc6I" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1750363557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=32/eRNIpRqAaL33JroebPLs2nRUW8C6R/EwCjVUixPk=; b=fOpPHc6IRg1liNoUETfgTHnCC0vUcKuDludfGX3keklXjFNxxA5JSY9zdlW2jjnHLKcxxP E40RL8Cf4TxN3h2OxmbWKV/Q56U/AB8RYXZlk+26y5Uuokv9UVmGMIYp8u6OUi7FLOBW8z 3pppyQUrkGYkFdl8NbQkpDTaErFRZx0= From: Sean Anderson To: Radhey Shyam Pandey , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Greg Kroah-Hartman Cc: Michal Simek , Saravana Kannan , Leon Romanovsky , Dave Ertman , linux-kernel@vger.kernel.org, Ira Weiny , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH net 2/4] net: axienet: Fix resource release ordering Date: Thu, 19 Jun 2025 16:05:35 -0400 Message-Id: <20250619200537.260017-3-sean.anderson@linux.dev> In-Reply-To: <20250619200537.260017-1-sean.anderson@linux.dev> References: <20250619200537.260017-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Device-managed resources are released after manually-managed resources. Therefore, once any manually-managed resource is acquired, all further resources must be manually-managed too. Convert all resources before the MDIO bus is created into device-managed resources. In all cases but one there are already devm variants available. Fixes: 46aa27df8853 ("net: axienet: Use devm_* calls") Signed-off-by: Sean Anderson --- .../net/ethernet/xilinx/xilinx_axienet_main.c | 89 ++++++++----------- 1 file changed, 37 insertions(+), 52 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 6011d7eae0c7..1f277e5e4a62 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2744,6 +2744,11 @@ static void axienet_dma_err_handler(struct work_stru= ct *work) axienet_setoptions(ndev, lp->options); } =20 +static void axienet_disable_misc(void *clocks) +{ + clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, clocks); +} + /** * axienet_probe - Axi Ethernet probe function. * @pdev: Pointer to platform device structure. @@ -2767,7 +2772,7 @@ static int axienet_probe(struct platform_device *pdev) int addr_width =3D 32; u32 value; =20 - ndev =3D alloc_etherdev(sizeof(*lp)); + ndev =3D devm_alloc_etherdev(&pdev->dev, sizeof(*lp)); if (!ndev) return -ENOMEM; =20 @@ -2795,22 +2800,17 @@ static int axienet_probe(struct platform_device *pd= ev) seqcount_mutex_init(&lp->hw_stats_seqcount, &lp->stats_lock); INIT_DEFERRABLE_WORK(&lp->stats_work, axienet_refresh_stats); =20 - lp->axi_clk =3D devm_clk_get_optional(&pdev->dev, "s_axi_lite_clk"); + lp->axi_clk =3D devm_clk_get_optional_enabled(&pdev->dev, + "s_axi_lite_clk"); if (!lp->axi_clk) { /* For backward compatibility, if named AXI clock is not present, * treat the first clock specified as the AXI clock. */ - lp->axi_clk =3D devm_clk_get_optional(&pdev->dev, NULL); - } - if (IS_ERR(lp->axi_clk)) { - ret =3D PTR_ERR(lp->axi_clk); - goto free_netdev; - } - ret =3D clk_prepare_enable(lp->axi_clk); - if (ret) { - dev_err(&pdev->dev, "Unable to enable AXI clock: %d\n", ret); - goto free_netdev; + lp->axi_clk =3D devm_clk_get_optional_enabled(&pdev->dev, NULL); } + if (IS_ERR(lp->axi_clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(lp->axi_clk), + "could not get AXI clock\n"); =20 lp->misc_clks[0].id =3D "axis_clk"; lp->misc_clks[1].id =3D "ref_clk"; @@ -2818,18 +2818,23 @@ static int axienet_probe(struct platform_device *pd= ev) =20 ret =3D devm_clk_bulk_get_optional(&pdev->dev, XAE_NUM_MISC_CLOCKS, lp->m= isc_clks); if (ret) - goto cleanup_clk; + return dev_err_probe(&pdev->dev, ret, + "could not get misc. clocks\n"); =20 ret =3D clk_bulk_prepare_enable(XAE_NUM_MISC_CLOCKS, lp->misc_clks); if (ret) - goto cleanup_clk; + return dev_err_probe(&pdev->dev, ret, + "could not enable misc. clocks\n"); + + ret =3D devm_add_action_or_reset(&pdev->dev, axienet_disable_misc, + lp->misc_clks); + if (ret) + return ret; =20 /* Map device registers */ lp->regs =3D devm_platform_get_and_ioremap_resource(pdev, 0, ðres); - if (IS_ERR(lp->regs)) { - ret =3D PTR_ERR(lp->regs); - goto cleanup_clk; - } + if (IS_ERR(lp->regs)) + return PTR_ERR(lp->regs); lp->regs_start =3D ethres->start; =20 /* Setup checksum offload, but default to off if not specified */ @@ -2898,19 +2903,17 @@ static int axienet_probe(struct platform_device *pd= ev) lp->phy_mode =3D PHY_INTERFACE_MODE_1000BASEX; break; default: - ret =3D -EINVAL; - goto cleanup_clk; + return -EINVAL; } } else { ret =3D of_get_phy_mode(pdev->dev.of_node, &lp->phy_mode); if (ret) - goto cleanup_clk; + return ret; } if (lp->switch_x_sgmii && lp->phy_mode !=3D PHY_INTERFACE_MODE_SGMII && lp->phy_mode !=3D PHY_INTERFACE_MODE_1000BASEX) { dev_err(&pdev->dev, "xlnx,switch-x-sgmii only supported with SGMII or 10= 00BaseX\n"); - ret =3D -EINVAL; - goto cleanup_clk; + return -EINVAL; } =20 if (!of_property_present(pdev->dev.of_node, "dmas")) { @@ -2925,7 +2928,7 @@ static int axienet_probe(struct platform_device *pdev) dev_err(&pdev->dev, "unable to get DMA resource\n"); of_node_put(np); - goto cleanup_clk; + return ret; } lp->dma_regs =3D devm_ioremap_resource(&pdev->dev, &dmares); @@ -2942,19 +2945,17 @@ static int axienet_probe(struct platform_device *pd= ev) } if (IS_ERR(lp->dma_regs)) { dev_err(&pdev->dev, "could not map DMA regs\n"); - ret =3D PTR_ERR(lp->dma_regs); - goto cleanup_clk; + return PTR_ERR(lp->dma_regs); } if (lp->rx_irq <=3D 0 || lp->tx_irq <=3D 0) { dev_err(&pdev->dev, "could not determine irqs\n"); - ret =3D -ENOMEM; - goto cleanup_clk; + return -ENOMEM; } =20 /* Reset core now that clocks are enabled, prior to accessing MDIO */ ret =3D __axienet_device_reset(lp); if (ret) - goto cleanup_clk; + return ret; =20 /* Autodetect the need for 64-bit DMA pointers. * When the IP is configured for a bus width bigger than 32 bits, @@ -2981,14 +2982,13 @@ static int axienet_probe(struct platform_device *pd= ev) } if (!IS_ENABLED(CONFIG_64BIT) && lp->features & XAE_FEATURE_DMA_64BIT) { dev_err(&pdev->dev, "64-bit addressable DMA is not compatible with 32-b= it architecture\n"); - ret =3D -EINVAL; - goto cleanup_clk; + return -EINVAL; } =20 ret =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(addr_width)); if (ret) { dev_err(&pdev->dev, "No suitable DMA available\n"); - goto cleanup_clk; + return ret; } netif_napi_add(ndev, &lp->napi_rx, axienet_rx_poll); netif_napi_add(ndev, &lp->napi_tx, axienet_tx_poll); @@ -2998,15 +2998,12 @@ static int axienet_probe(struct platform_device *pd= ev) =20 lp->eth_irq =3D platform_get_irq_optional(pdev, 0); if (lp->eth_irq < 0 && lp->eth_irq !=3D -ENXIO) { - ret =3D lp->eth_irq; - goto cleanup_clk; + return lp->eth_irq; } tx_chan =3D dma_request_chan(lp->dev, "tx_chan0"); - if (IS_ERR(tx_chan)) { - ret =3D PTR_ERR(tx_chan); - dev_err_probe(lp->dev, ret, "No Ethernet DMA (TX) channel found\n"); - goto cleanup_clk; - } + if (IS_ERR(tx_chan)) + return dev_err_probe(lp->dev, PTR_ERR(tx_chan), + "No Ethernet DMA (TX) channel found\n"); =20 cfg.reset =3D 1; /* As name says VDMA but it has support for DMA channel reset */ @@ -3014,7 +3011,7 @@ static int axienet_probe(struct platform_device *pdev) if (ret < 0) { dev_err(&pdev->dev, "Reset channel failed\n"); dma_release_channel(tx_chan); - goto cleanup_clk; + return ret; } =20 dma_release_channel(tx_chan); @@ -3119,13 +3116,6 @@ static int axienet_probe(struct platform_device *pde= v) put_device(&lp->pcs_phy->dev); if (lp->mii_bus) axienet_mdio_teardown(lp); -cleanup_clk: - clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks); - clk_disable_unprepare(lp->axi_clk); - -free_netdev: - free_netdev(ndev); - return ret; } =20 @@ -3143,11 +3133,6 @@ static void axienet_remove(struct platform_device *p= dev) put_device(&lp->pcs_phy->dev); =20 axienet_mdio_teardown(lp); - - clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks); - clk_disable_unprepare(lp->axi_clk); - - free_netdev(ndev); } =20 static void axienet_shutdown(struct platform_device *pdev) --=20 2.35.1.1320.gc452695387.dirty From nobody Thu Oct 9 04:43:24 2025 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E53A92566FD for ; Thu, 19 Jun 2025 20:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363563; cv=none; b=ttht1bm2k6IzPuXKLUdxbgjSYliFmi/+XzeaFmlm325SAC9tRwRiomDC0DEDZMdGjVq/GvsNpfJ4kVl8xsXA27WQsCNxw5WbWTFFa0dKWeOj+bzvEgXkiJ1daDN1vZonGa4dkd4Z/0h7kBRBh2s3SlB4t1dYFw7flur99GpduWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363563; c=relaxed/simple; bh=C6LbQKFSIVMacHbPRAYuDgegKEijLlCqHPXIPsTipao=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=D1ogClr7cY5v50KZwPeTGqhomYuhHOlsB6O+IHArSzxgh/8clHnvmVcvXYJ+jM3U+iCrozHLz1xRkZEW00WLZAL0tp6r9jBMznREZCGlmmHqgtUMEZ5AbcW7EE9qGzIxptJVhleVKT/HS+AheoYzTiVUz86NQ/cJgqw7ey7PEOw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=klFtIT1y; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="klFtIT1y" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1750363559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qv3D2YlZx4ysbIurldj8bJMj04966kkw5o/UpPt70N8=; b=klFtIT1yuBhS6vfklk507j8tk7YFL+7lXRw9vS9DKcsN7bFsVCm5j77Ghrap0Mue8Z7KZB MnJ0oUbwqG5AFQrCV1x/lH02TZf8xmEkJIUsScfKKY61KwQUP1CAiXFbLp24CVpmrrXBsa ywZ84aO+03kCpjaeH3MbLPh1zcJwuwU= From: Sean Anderson To: Radhey Shyam Pandey , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Greg Kroah-Hartman Cc: Michal Simek , Saravana Kannan , Leon Romanovsky , Dave Ertman , linux-kernel@vger.kernel.org, Ira Weiny , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH net 3/4] net: axienet: Rearrange lifetime functions Date: Thu, 19 Jun 2025 16:05:36 -0400 Message-Id: <20250619200537.260017-4-sean.anderson@linux.dev> In-Reply-To: <20250619200537.260017-1-sean.anderson@linux.dev> References: <20250619200537.260017-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Rearrange the lifetime functions (probe, remove, etc.) in preparation for the next commit. No functional change intended. Signed-off-by: Sean Anderson --- .../net/ethernet/xilinx/xilinx_axienet_main.c | 252 +++++++++--------- 1 file changed, 133 insertions(+), 119 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index 1f277e5e4a62..c2512c04a88f 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2749,6 +2749,134 @@ static void axienet_disable_misc(void *clocks) clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, clocks); } =20 +static int axienet_mac_probe(struct axienet_local *lp) +{ + struct net_device *ndev =3D lp->ndev; + struct device_node *np; + int ret; + + SET_NETDEV_DEV(ndev, lp->dev); + if (lp->phy_mode =3D=3D PHY_INTERFACE_MODE_SGMII || + lp->phy_mode =3D=3D PHY_INTERFACE_MODE_1000BASEX) { + np =3D of_parse_phandle(lp->dev->of_node, "pcs-handle", 0); + if (!np) { + /* Deprecated: Always use "pcs-handle" for pcs_phy. + * Falling back to "phy-handle" here is only for + * backward compatibility with old device trees. + */ + np =3D of_parse_phandle(lp->dev->of_node, "phy-handle", 0); + } + if (!np) { + dev_err(lp->dev, + "pcs-handle (preferred) or phy-handle required for 1000BaseX/SGMII\n"); + return -EINVAL; + } + lp->pcs_phy =3D of_mdio_find_device(np); + of_node_put(np); + if (!lp->pcs_phy) + return -EPROBE_DEFER; + lp->pcs.ops =3D &axienet_pcs_ops; + lp->pcs.poll =3D true; + } + + lp->phylink_config.dev =3D &ndev->dev; + lp->phylink_config.type =3D PHYLINK_NETDEV; + lp->phylink_config.mac_managed_pm =3D true; + lp->phylink_config.mac_capabilities =3D MAC_SYM_PAUSE | MAC_ASYM_PAUSE | + MAC_10FD | MAC_100FD | MAC_1000FD; + + __set_bit(lp->phy_mode, lp->phylink_config.supported_interfaces); + if (lp->switch_x_sgmii) { + __set_bit(PHY_INTERFACE_MODE_1000BASEX, + lp->phylink_config.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_SGMII, + lp->phylink_config.supported_interfaces); + } + + lp->phylink =3D phylink_create(&lp->phylink_config, lp->dev->fwnode, + lp->phy_mode, + &axienet_phylink_ops); + if (IS_ERR(lp->phylink)) { + ret =3D PTR_ERR(lp->phylink); + dev_err(lp->dev, "phylink_create error (%i)\n", ret); + goto cleanup_pcs; + } + + ret =3D register_netdev(ndev); + if (ret) { + dev_err(lp->dev, "register_netdev() error (%i)\n", ret); + goto cleanup_phylink; + } + + return 0; + +cleanup_phylink: + phylink_destroy(lp->phylink); +cleanup_pcs: + if (lp->pcs_phy) + put_device(&lp->pcs_phy->dev); + return ret; +} + +static void axienet_mac_remove(struct platform_device *pdev) +{ + struct net_device *ndev =3D platform_get_drvdata(pdev); + struct axienet_local *lp =3D netdev_priv(ndev); + + unregister_netdev(ndev); + phylink_destroy(lp->phylink); + if (lp->pcs_phy) + put_device(&lp->pcs_phy->dev); +} + +static void axienet_mac_shutdown(struct platform_device *pdev) +{ + struct net_device *ndev =3D platform_get_drvdata(pdev); + + rtnl_lock(); + netif_device_detach(ndev); + + if (netif_running(ndev)) + dev_close(ndev); + + rtnl_unlock(); +} + +static int axienet_suspend(struct device *dev) +{ + struct net_device *ndev =3D dev_get_drvdata(dev); + + if (!netif_running(ndev)) + return 0; + + netif_device_detach(ndev); + + rtnl_lock(); + axienet_stop(ndev); + rtnl_unlock(); + + return 0; +} + +static int axienet_resume(struct device *dev) +{ + struct net_device *ndev =3D dev_get_drvdata(dev); + + if (!netif_running(ndev)) + return 0; + + rtnl_lock(); + axienet_open(ndev); + rtnl_unlock(); + + netif_device_attach(ndev); + + return 0; +} + +static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops, + axienet_suspend, axienet_resume); + /** * axienet_probe - Axi Ethernet probe function. * @pdev: Pointer to platform device structure. @@ -3051,69 +3179,10 @@ static int axienet_probe(struct platform_device *pd= ev) dev_warn(&pdev->dev, "error registering MDIO bus: %d\n", ret); =20 - if (lp->phy_mode =3D=3D PHY_INTERFACE_MODE_SGMII || - lp->phy_mode =3D=3D PHY_INTERFACE_MODE_1000BASEX) { - np =3D of_parse_phandle(pdev->dev.of_node, "pcs-handle", 0); - if (!np) { - /* Deprecated: Always use "pcs-handle" for pcs_phy. - * Falling back to "phy-handle" here is only for - * backward compatibility with old device trees. - */ - np =3D of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); - } - if (!np) { - dev_err(&pdev->dev, "pcs-handle (preferred) or phy-handle required for = 1000BaseX/SGMII\n"); - ret =3D -EINVAL; - goto cleanup_mdio; - } - lp->pcs_phy =3D of_mdio_find_device(np); - if (!lp->pcs_phy) { - ret =3D -EPROBE_DEFER; - of_node_put(np); - goto cleanup_mdio; - } - of_node_put(np); - lp->pcs.ops =3D &axienet_pcs_ops; - lp->pcs.poll =3D true; - } + ret =3D axienet_mac_probe(lp); + if (!ret) + return 0; =20 - lp->phylink_config.dev =3D &ndev->dev; - lp->phylink_config.type =3D PHYLINK_NETDEV; - lp->phylink_config.mac_managed_pm =3D true; - lp->phylink_config.mac_capabilities =3D MAC_SYM_PAUSE | MAC_ASYM_PAUSE | - MAC_10FD | MAC_100FD | MAC_1000FD; - - __set_bit(lp->phy_mode, lp->phylink_config.supported_interfaces); - if (lp->switch_x_sgmii) { - __set_bit(PHY_INTERFACE_MODE_1000BASEX, - lp->phylink_config.supported_interfaces); - __set_bit(PHY_INTERFACE_MODE_SGMII, - lp->phylink_config.supported_interfaces); - } - - lp->phylink =3D phylink_create(&lp->phylink_config, pdev->dev.fwnode, - lp->phy_mode, - &axienet_phylink_ops); - if (IS_ERR(lp->phylink)) { - ret =3D PTR_ERR(lp->phylink); - dev_err(&pdev->dev, "phylink_create error (%i)\n", ret); - goto cleanup_mdio; - } - - ret =3D register_netdev(lp->ndev); - if (ret) { - dev_err(lp->dev, "register_netdev() error (%i)\n", ret); - goto cleanup_phylink; - } - - return 0; - -cleanup_phylink: - phylink_destroy(lp->phylink); - -cleanup_mdio: - if (lp->pcs_phy) - put_device(&lp->pcs_phy->dev); if (lp->mii_bus) axienet_mdio_teardown(lp); return ret; @@ -3124,69 +3193,14 @@ static void axienet_remove(struct platform_device *= pdev) struct net_device *ndev =3D platform_get_drvdata(pdev); struct axienet_local *lp =3D netdev_priv(ndev); =20 - unregister_netdev(ndev); - - if (lp->phylink) - phylink_destroy(lp->phylink); - - if (lp->pcs_phy) - put_device(&lp->pcs_phy->dev); - + axienet_mac_remove(pdev); axienet_mdio_teardown(lp); } =20 -static void axienet_shutdown(struct platform_device *pdev) -{ - struct net_device *ndev =3D platform_get_drvdata(pdev); - - rtnl_lock(); - netif_device_detach(ndev); - - if (netif_running(ndev)) - dev_close(ndev); - - rtnl_unlock(); -} - -static int axienet_suspend(struct device *dev) -{ - struct net_device *ndev =3D dev_get_drvdata(dev); - - if (!netif_running(ndev)) - return 0; - - netif_device_detach(ndev); - - rtnl_lock(); - axienet_stop(ndev); - rtnl_unlock(); - - return 0; -} - -static int axienet_resume(struct device *dev) -{ - struct net_device *ndev =3D dev_get_drvdata(dev); - - if (!netif_running(ndev)) - return 0; - - rtnl_lock(); - axienet_open(ndev); - rtnl_unlock(); - - netif_device_attach(ndev); - - return 0; -} - -static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops, - axienet_suspend, axienet_resume); - static struct platform_driver axienet_driver =3D { .probe =3D axienet_probe, .remove =3D axienet_remove, - .shutdown =3D axienet_shutdown, + .shutdown =3D axienet_mac_shutdown, .driver =3D { .name =3D "xilinx_axienet", .pm =3D &axienet_pm_ops, --=20 2.35.1.1320.gc452695387.dirty From nobody Thu Oct 9 04:43:24 2025 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31BDA28C871 for ; Thu, 19 Jun 2025 20:06:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363567; cv=none; b=DTsBLuY5nStKvrJzS1RLbKlyODjBoLnpHdr839I1rmbefps23nTzj/sgG2dRCUBTgCnI7sxJJna5HboBbDkOajH+RqFXUxNZz9g8KBmK9JKsEoi4LYE+lv4qHMI6MinzmzgTckSIVpYYY4TKKWoSvjpOJMMUPO3/kwNyemJKvY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750363567; c=relaxed/simple; bh=5PZ+4WWb+yQi/lgbKFA3FVfXQQqIIkyh4GV442J2zB0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pduJz2y27KbFqx3GTSg1QhHAgB0uTc1CoHOP7/Nrym19lo39cJLDgcmesZPAcXzBgMSwBapdLKdElikH1oXzN5eyroUGVCTvL0WpunTZRY3IN3L8k+/eO+1bw4SmTXWEW3NymnlrLdjdYh+9N3VMG4F/3fsZ0yETkqy9DRnDTgM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=S6RAREr+; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="S6RAREr+" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1750363562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vmQh7WNBVytuG3QTxljJy01b4onL5r5Bw3fy3XKBb7A=; b=S6RAREr+EK8Wrm17Ow34FNmnhd4HEdrIrRkz7Yie++mIN+YjzsZ1sSVqk13hhiMV0sNQWW F3liv5meZxympZ3TXsSE8QaCe+02JQa5qPxVvKm0UpWqlLsO97WqyNPzv+L9SApzvPNFPs nHwQt1/9/34mf2e3dkOyka2sYbdfO4Q= From: Sean Anderson To: Radhey Shyam Pandey , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Greg Kroah-Hartman Cc: Michal Simek , Saravana Kannan , Leon Romanovsky , Dave Ertman , linux-kernel@vger.kernel.org, Ira Weiny , linux-arm-kernel@lists.infradead.org, Sean Anderson Subject: [PATCH net 4/4] net: axienet: Split into MAC and MDIO drivers Date: Thu, 19 Jun 2025 16:05:37 -0400 Message-Id: <20250619200537.260017-5-sean.anderson@linux.dev> In-Reply-To: <20250619200537.260017-1-sean.anderson@linux.dev> References: <20250619200537.260017-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Returning EPROBE_DEFER after probing a bus may result in an infinite probe loop if the EPROBE_DEFER error is never resolved. For example, if the PCS is located on another MDIO bus and that MDIO bus is missing its driver then we will always return EPROBE_DEFER. But if there are any devices on our own MDIO bus (such as PHYs), those devices will be successfully bound before we fail our own probe. This will cause the deferred probing infrastructure to continuously try to probe our device. To prevent this, split the MAC and MDIO functionality into separate auxiliary devices. These can then be re-probed independently. Fixes: 1a02556086fc ("net: axienet: Properly handle PCS/PMA PHY for 1000Bas= eX mode") Signed-off-by: Sean Anderson --- drivers/net/ethernet/xilinx/Kconfig | 1 + .../net/ethernet/xilinx/xilinx_axienet_main.c | 76 +++++++++++-------- .../net/ethernet/xilinx/xilinx_axienet_mdio.c | 32 +++++--- 3 files changed, 69 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/xilinx/Kconfig b/drivers/net/ethernet/xil= inx/Kconfig index 7502214cc7d5..3b940d2d3115 100644 --- a/drivers/net/ethernet/xilinx/Kconfig +++ b/drivers/net/ethernet/xilinx/Kconfig @@ -27,6 +27,7 @@ config XILINX_AXI_EMAC tristate "Xilinx 10/100/1000 AXI Ethernet support" depends on HAS_IOMEM depends on XILINX_DMA + select AUXILIARY_BUS select PHYLINK select DIMLIB help diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_main.c index c2512c04a88f..2f26474b16f6 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -22,6 +22,7 @@ * - Add support for extended VLAN support. */ =20 +#include #include #include #include @@ -2749,13 +2750,16 @@ static void axienet_disable_misc(void *clocks) clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, clocks); } =20 -static int axienet_mac_probe(struct axienet_local *lp) +static int axienet_mac_probe(struct auxiliary_device *auxdev, + const struct auxiliary_device_id *id) { + struct axienet_local *lp =3D auxdev->dev.platform_data; struct net_device *ndev =3D lp->ndev; struct device_node *np; int ret; =20 - SET_NETDEV_DEV(ndev, lp->dev); + auxiliary_set_drvdata(auxdev, ndev); + SET_NETDEV_DEV(ndev, &auxdev->dev); if (lp->phy_mode =3D=3D PHY_INTERFACE_MODE_SGMII || lp->phy_mode =3D=3D PHY_INTERFACE_MODE_1000BASEX) { np =3D of_parse_phandle(lp->dev->of_node, "pcs-handle", 0); @@ -2818,9 +2822,9 @@ static int axienet_mac_probe(struct axienet_local *lp) return ret; } =20 -static void axienet_mac_remove(struct platform_device *pdev) +static void axienet_mac_remove(struct auxiliary_device *auxdev) { - struct net_device *ndev =3D platform_get_drvdata(pdev); + struct net_device *ndev =3D auxiliary_get_drvdata(auxdev); struct axienet_local *lp =3D netdev_priv(ndev); =20 unregister_netdev(ndev); @@ -2829,9 +2833,9 @@ static void axienet_mac_remove(struct platform_device= *pdev) put_device(&lp->pcs_phy->dev); } =20 -static void axienet_mac_shutdown(struct platform_device *pdev) +static void axienet_mac_shutdown(struct auxiliary_device *auxdev) { - struct net_device *ndev =3D platform_get_drvdata(pdev); + struct net_device *ndev =3D auxiliary_get_drvdata(auxdev); =20 rtnl_lock(); netif_device_detach(ndev); @@ -2877,6 +2881,24 @@ static int axienet_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops, axienet_suspend, axienet_resume); =20 +static const struct auxiliary_device_id xilinx_axienet_mac_id_table[] =3D { + { .name =3D KBUILD_MODNAME ".mac", }, + { }, +}; +MODULE_DEVICE_TABLE(auxiliary, xilinx_axienet_mac_id_table); + +static struct auxiliary_driver xilinx_axienet_mac =3D { + .name =3D "mac", + .id_table =3D xilinx_axienet_mac_id_table, + .probe =3D axienet_mac_probe, + .remove =3D axienet_mac_remove, + .shutdown =3D axienet_mac_shutdown, + .driver =3D { + .pm =3D &axienet_pm_ops, + }, +}; +module_auxiliary_driver(xilinx_axienet_mac) + /** * axienet_probe - Axi Ethernet probe function. * @pdev: Pointer to platform device structure. @@ -2892,12 +2914,14 @@ static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops, static int axienet_probe(struct platform_device *pdev) { int ret; + struct auxiliary_device *auxdev; struct device_node *np; struct axienet_local *lp; struct net_device *ndev; struct resource *ethres; u8 mac_addr[ETH_ALEN]; int addr_width =3D 32; + char name[20]; u32 value; =20 ndev =3D devm_alloc_etherdev(&pdev->dev, sizeof(*lp)); @@ -2906,7 +2930,6 @@ static int axienet_probe(struct platform_device *pdev) =20 platform_set_drvdata(pdev, ndev); =20 - SET_NETDEV_DEV(ndev, &pdev->dev); ndev->features =3D NETIF_F_SG; ndev->ethtool_ops =3D &axienet_ethtool_ops; =20 @@ -3174,36 +3197,27 @@ static int axienet_probe(struct platform_device *pd= ev) lp->tx_dma_cr =3D axienet_calc_cr(lp, XAXIDMA_DFT_TX_THRESHOLD, XAXIDMA_DFT_TX_USEC); =20 - ret =3D axienet_mdio_setup(lp); - if (ret) - dev_warn(&pdev->dev, - "error registering MDIO bus: %d\n", ret); - - ret =3D axienet_mac_probe(lp); - if (!ret) - return 0; - - if (lp->mii_bus) - axienet_mdio_teardown(lp); - return ret; -} - -static void axienet_remove(struct platform_device *pdev) -{ - struct net_device *ndev =3D platform_get_drvdata(pdev); - struct axienet_local *lp =3D netdev_priv(ndev); - - axienet_mac_remove(pdev); - axienet_mdio_teardown(lp); + snprintf(name, sizeof(name), "mdio.%llx", + (unsigned long long)lp->regs_start); + auxdev =3D devm_auxiliary_device_create(&pdev->dev, name, lp); + if (IS_ERR(auxdev)) + return dev_err_probe(&pdev->dev, PTR_ERR(auxdev), + "could not create MDIO bus\n"); + + snprintf(name, sizeof(name), "mac.%llx", + (unsigned long long)lp->regs_start); + auxdev =3D devm_auxiliary_device_create(&pdev->dev, name, lp); + if (IS_ERR(auxdev)) + return dev_err_probe(&pdev->dev, PTR_ERR(auxdev), + "could not create MAC\n"); + + return 0; } =20 static struct platform_driver axienet_driver =3D { .probe =3D axienet_probe, - .remove =3D axienet_remove, - .shutdown =3D axienet_mac_shutdown, .driver =3D { .name =3D "xilinx_axienet", - .pm =3D &axienet_pm_ops, .of_match_table =3D axienet_of_match, }, }; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/ne= t/ethernet/xilinx/xilinx_axienet_mdio.c index 9ca2643c921e..8874525ec3f3 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c @@ -9,6 +9,7 @@ * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. */ =20 +#include #include #include #include @@ -277,12 +278,15 @@ static int axienet_mdio_enable(struct axienet_local *= lp, struct device_node *np) * Sets up the MDIO interface by initializing the MDIO clock. * Register the MDIO interface. **/ -int axienet_mdio_setup(struct axienet_local *lp) +static int axienet_mdio_probe(struct auxiliary_device *auxdev, + const struct auxiliary_device_id *id) { + struct axienet_local *lp =3D auxdev->dev.platform_data; struct device_node *mdio_node; struct mii_bus *bus; int ret; =20 + auxiliary_set_drvdata(auxdev, lp); bus =3D mdiobus_alloc(); if (!bus) return -ENOMEM; @@ -294,7 +298,7 @@ int axienet_mdio_setup(struct axienet_local *lp) bus->name =3D "Xilinx Axi Ethernet MDIO"; bus->read =3D axienet_mdio_read; bus->write =3D axienet_mdio_write; - bus->parent =3D lp->dev; + bus->parent =3D &auxdev->dev; lp->mii_bus =3D bus; =20 mdio_node =3D of_get_child_by_name(lp->dev->of_node, "mdio"); @@ -317,15 +321,25 @@ int axienet_mdio_setup(struct axienet_local *lp) return ret; } =20 -/** - * axienet_mdio_teardown - MDIO remove function - * @lp: Pointer to axienet local data structure. - * - * Unregisters the MDIO and frees any associate memory for mii bus. - */ -void axienet_mdio_teardown(struct axienet_local *lp) +static void axienet_mdio_remove(struct auxiliary_device *auxdev) { + struct axienet_local *lp =3D auxiliary_get_drvdata(auxdev); + mdiobus_unregister(lp->mii_bus); mdiobus_free(lp->mii_bus); lp->mii_bus =3D NULL; } + +static const struct auxiliary_device_id xilinx_axienet_mdio_id_table[] =3D= { + { .name =3D KBUILD_MODNAME ".mdio", }, + { }, +}; +MODULE_DEVICE_TABLE(auxiliary, xilinx_axienet_mdio_id_table); + +static struct auxiliary_driver xilinx_axienet_mdio =3D { + .name =3D "mdio", + .id_table =3D xilinx_axienet_mdio_id_table, + .probe =3D axienet_mdio_probe, + .remove =3D axienet_mdio_remove, +}; +module_auxiliary_driver(xilinx_axienet_mdio) --=20 2.35.1.1320.gc452695387.dirty