From nobody Sun Feb 8 18:28:28 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (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 213D4366814; Wed, 4 Feb 2026 05:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770182801; cv=none; b=iI+JV+2om05Be9JBYHPVeg04KHQep8v0SQUJ2NYWEUn7cp4BDlD1p1FIhSxsXd3FzelhbAOOl5ssXssqZGk3qKj0qXeCrCLNhVaokOa5LXjOgr1xJ8gMvRhpJyni+30WKb2iz05fb3z0RhDhqsJG0hVEWirAna7iuMotbnvF6X4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770182801; c=relaxed/simple; bh=onLWbZUbnTMgDK4y8kzfyvlIWWGQE8LKDFBj5Fq38Dw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=nZ4gRN+oXEw9KWSO2NVFeMNh7boioyORdeOqlPzS4ZS6KzCgIA/tKiixYudQSIZBFhntNoMQEQIw/LguM8fo3OsXsPtws/8rw2cx35spSpWjDqscD8GAo+fzhSDJYsgyr/FlsM2rLmwr1e4DK5QkAiqXaXLAzvqP04ngN0oeTgM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Wed, 4 Feb 2026 13:26:30 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Wed, 4 Feb 2026 13:26:30 +0800 From: Jacky Chou Date: Wed, 4 Feb 2026 13:26:30 +0800 Subject: [PATCH net-next v4 04/15] net: ftgmac100: Use devm_alloc_etherdev() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260204-ftgmac-cleanup-v4-4-b7f379939b76@aspeedtech.com> References: <20260204-ftgmac-cleanup-v4-0-b7f379939b76@aspeedtech.com> In-Reply-To: <20260204-ftgmac-cleanup-v4-0-b7f379939b76@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770182790; l=1418; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=o3nIYAscEW7qqYCVm0zoQKSDXM36iO60MZ4R096iN0U=; b=FfQWVi5FdhqbaC0Rz9e6BhdGZ0lHXWkXaD5xxB9cYcE0fl8pGcceYwKZhC+SFUzID7M48EzQA KzPoQcvltWnDSPdCZNHFMLomPvg+HDhnMCAEPV8blvszm+dzV1j72fA X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Make use of devm_alloc_etherdev() to simplify cleanup. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index f07167cabf39..397ada43c851 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1877,11 +1877,9 @@ static int ftgmac100_probe(struct platform_device *p= dev) return irq; =20 /* setup net_device */ - netdev =3D alloc_etherdev(sizeof(*priv)); - if (!netdev) { - err =3D -ENOMEM; - goto err_alloc_etherdev; - } + netdev =3D devm_alloc_etherdev(&pdev->dev, sizeof(*priv)); + if (!netdev) + return -ENOMEM; =20 SET_NETDEV_DEV(netdev, &pdev->dev); =20 @@ -2080,8 +2078,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) err_ioremap: release_resource(priv->res); err_req_mem: - free_netdev(netdev); -err_alloc_etherdev: return err; } =20 @@ -2112,7 +2108,6 @@ static void ftgmac100_remove(struct platform_device *= pdev) release_resource(priv->res); =20 netif_napi_del(&priv->napi); - free_netdev(netdev); } =20 static const struct ftgmac100_match_data ftgmac100_match_data_ast2400 =3D { --=20 2.34.1