From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D65119F42E; Mon, 30 Sep 2024 20:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727879; cv=none; b=av47wLbAmPMl+eifRJOfBAzqhNTmux/LCAOIwnJDXW+WbKCCA6LVzna9+Vdp3EkoNBgD3mWipKXKz+Wgq4lEcQ1bYeElpODBakMXXo35eyLXWNU/GYC7TOqpiz1nRMtF++OvV8w5XWhiehCWZJGDilD/IAWFXn4GN04s+OISp4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727879; c=relaxed/simple; bh=QlbONOqz1K0XWEos9xTIVvmpV0mzdmbc6M33HeTBch0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=icw/+QRnfGEJV+Mm/+uoiSytXflvFtXKHlSzG4g6qDTRoCtRwNBwmNchIHV/BttgkAVJPWgTKIw0tLXxnzX+24NEc8E+XvnPo0iWRKDI6Oc9shTQ4kC/arhFersaVY7z7a3PKsz4JYucOugFfIrws/UkiKbl3WT4B9ZS1nRlThA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MJaYdCD6; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJaYdCD6" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-717934728adso3650980b3a.2; Mon, 30 Sep 2024 13:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727878; x=1728332678; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hzx552Qp8I6tvYVdnDmUIDQNHhaHMQHL12jQp5qE218=; b=MJaYdCD6gHIIt57wOVT2I1ncOlIW9rwO3yqmkBeh0zwsadDLfHS3ZDCtJL8uy0QFx+ 6LRkLzhFM6A864pSmQEBPhCoME9H7Xm1iqhr6J+zClsqoJKzLJXQ3fG8cAISZk4uWYA2 Vmrd14+3WMw+GkOPzA3HPShtfSmmE6iUPLzDVitqS7NFhBNIj/fcrj2a42B/tXnOVii/ EJNgLjYsPb1SESXWxXMpZoe1hPMezcXjd4UxbQzQI87+Fh2hFE9+maJbT8aLTOViIDuV RU8IGNjSz/Il5ifP7p7PU2Y5aRf4Mibik4l08OId7jvdYfyRXBP43MqGiKR9hmxN5P2R mTnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727878; x=1728332678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hzx552Qp8I6tvYVdnDmUIDQNHhaHMQHL12jQp5qE218=; b=BQ8L3s524E2wleexJtdysntZs8bl3d0pYwXBqBsCsjeknjoou4upTLP22Uzwxmg36H GGUWb9F1VEd4wK18cBSKPrbpvz3aFgMDA0WMj6LfrCIyuHjJ2uChwYyITcjQN6fB1BZD LG1hMCvb2BZRttvttx/ooY0Fidc5AfhfGkisBA1r0Lqg+UBXWwW1kOUVrL0oIcavlSmM ySqqe5Yk/uW1o7dTOv1eJPc0/CZAW89c0MbKpcgRgtqvWXTxeXnEuG65CW6pvHb0+XEB 9Na7OT+Nfn6SiSDVxo0geovCe/zotQUhftAy+QbY5gsdDOMct+y46rF/v52ULCJro1SK CPMw== X-Forwarded-Encrypted: i=1; AJvYcCUFE5bNpRtSnpe5RuCHo3kecMLGRL/6s3GmZGG2YC5cUYFN6dVf2xS/hP54u42pm1vpJr+XMv234r3u+0Y=@vger.kernel.org X-Gm-Message-State: AOJu0YwC7SPzBg67DHbIvZdmCKiq92HC23UrnfN0ujRnhGVlL05Kd3Fd lIkNMYG2CJ3cfkn+AiExAeeoMFt3WRhcnWsgtwloIwvsP7y5PA+rDw9vM2Ka X-Google-Smtp-Source: AGHT+IF/gNOFFvcOrGW0xURPuzG12o30PppK4sbSjTPXG8TQN1pU2wAFd1y/odMUYCwBkgYr8SvFqw== X-Received: by 2002:a05:6a00:228e:b0:70d:2708:d7ec with SMTP id d2e1a72fcca58-71b25f2aab9mr17767492b3a.5.1727727877573; Mon, 30 Sep 2024 13:24:37 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:37 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 1/9] net: lantiq_etop: use netif_receive_skb_list Date: Mon, 30 Sep 2024 13:24:26 -0700 Message-ID: <20240930202434.296960-2-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" Improves cache efficiency by batching rx skb processing. Small performance improvement on RX. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 3c289bfe0a09..94b37c12f3f7 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -122,8 +122,7 @@ ltq_etop_alloc_skb(struct ltq_etop_chan *ch) return 0; } =20 -static void -ltq_etop_hw_receive(struct ltq_etop_chan *ch) +static void ltq_etop_hw_receive(struct ltq_etop_chan *ch, struct list_head= *lh) { struct ltq_etop_priv *priv =3D netdev_priv(ch->netdev); struct ltq_dma_desc *desc =3D &ch->dma.desc_base[ch->dma.desc]; @@ -143,7 +142,7 @@ ltq_etop_hw_receive(struct ltq_etop_chan *ch) =20 skb_put(skb, len); skb->protocol =3D eth_type_trans(skb, ch->netdev); - netif_receive_skb(skb); + list_add_tail(&skb->list, lh); } =20 static int @@ -151,6 +150,7 @@ ltq_etop_poll_rx(struct napi_struct *napi, int budget) { struct ltq_etop_chan *ch =3D container_of(napi, struct ltq_etop_chan, napi); + LIST_HEAD(rx_list); int work_done =3D 0; =20 while (work_done < budget) { @@ -158,9 +158,12 @@ ltq_etop_poll_rx(struct napi_struct *napi, int budget) =20 if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) !=3D LTQ_DMA_C) break; - ltq_etop_hw_receive(ch); + ltq_etop_hw_receive(ch, &rx_list); work_done++; } + + netif_receive_skb_list(&rx_list); + if (work_done < budget) { napi_complete_done(&ch->napi, work_done); ltq_dma_ack_irq(&ch->dma); --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 006BC1A254B; Mon, 30 Sep 2024 20:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727881; cv=none; b=uV520wjUmaemLuE8GsusDfHX6m92c/NT+xkrKPpEuhxIeHNkT8IHSQNQ2KcMsUQS9qbxPD/8obX/vYm9+3UDfXFHpsGfdwxmJKuXqxFWJ0Bd1GMHySJK8psnvlnoZaEumeLFPfVX8o8Ov9jNNSxfpyD+Fo5332JWX+Ir6FLWFoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727881; c=relaxed/simple; bh=+2YbOAsmqGFAN3DsO0ZA0iMaXoNb9kIy17mhXGFmZDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W5sguFA1r9tOAgUNoZq4NKmzyQAeOx+uhk6Uzd8FByGDTHHHW1EoPVWoCoJ8NP7/XblI1evJSEuvVlNDdk4LbGL/ooMBguE0LjsZqHmyJDAgvK//9XbR53GVZvQpP/s/mOc9eKafbHoi7CHEflkQ/RaFPGSvds+dqYfsEsi7m9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KLm6NUoH; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KLm6NUoH" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-71979bf5e7aso3501128b3a.1; Mon, 30 Sep 2024 13:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727879; x=1728332679; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ULD/SZGendmtIkaIIrGrKxIivyFI3b2S9pE06yiU47M=; b=KLm6NUoHfydSYV2SMdWeISDE0FsT8es3op8LB0iNyUup116RlHc7jFR+Ey40s1hG7C WNXnD3NJkSobiwC4ld6dm8bjVkcbUOyGMsBRqaeBLcJK3+I7LCmwLXsviFIpTZkVdFTd C5e7Hf8X6w21Xg0Etpp1Fjsk/k3rDaDdXxYkyf5kXJKvjxfSubC3ADTqqjH3I92suYbh IBK0/LY9RREIy9Iykcfm4GH4yFvUPT/dxutiqsk/IECxYW3jLieynj/CbKYRQn+o7PNa plblIynWTsK21HGQv9qipWMm5uYMyVb2wB0ssVsAnDjBVLpYbiVdPJloN+3CJNfW50Fc UueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727879; x=1728332679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ULD/SZGendmtIkaIIrGrKxIivyFI3b2S9pE06yiU47M=; b=wZ9U/F4imGRgrysqO4+daJUTPSq2G2a/uiWKwI2I9CJEkbFYFnSMAF8J/PgTEGT++T wtKsJ02QPTE/7YSxKndf/94i37/Y8ZaP7C1oT/RRriYmtv4Fw2JFO7Nv8ks6vH31Wkc1 eZ/3ZyFgyWCg6dTK9qr89MAPUNUveTaMIqi3JYVwbfEYqrd4V3IUi79D/6cwVg0cm3uA qMEcewbUrqHYv1VLEMd3rjI524J7J4Av33vLnoWX36xIr9mKAyrp/ltSVXEr3TXJckle cUzPg9B0/ZHPH1+bgQX3A3YjNYwC89yzvAoHHqBuk8UNiwJvil1xQW9zQBrFUk2Clt4s U1Yg== X-Forwarded-Encrypted: i=1; AJvYcCWALALM3RK8kUeQ6+/N00zpgXKCEEcZvC8k5MnaDf5N4u4rgGME9uh1ED6lUkn88Qn1xitGtaftxT1mH/4=@vger.kernel.org X-Gm-Message-State: AOJu0YxFOL+q8WwYCLGI8a4uPAAO85cu0X9gir6r0PCYSxvc9bnKnNlF p9qsbkE60H2PXcky0yE0j2E8O7MsYSSbpBAk9SjXKNxKX69bRE7nDfI9adhk X-Google-Smtp-Source: AGHT+IHJn+3sGPKEGZZ3Tgifv4+SIpxYDrPYVVzDdi3bhQNpzECkQraYEWtZyxRoav5wejuMhG5FDg== X-Received: by 2002:a05:6a00:2d9b:b0:718:e51e:bd25 with SMTP id d2e1a72fcca58-71b26083144mr18746774b3a.25.1727727879048; Mon, 30 Sep 2024 13:24:39 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:38 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 2/9] net: lantiq_etop: use devm_alloc_etherdev_mqs Date: Mon, 30 Sep 2024 13:24:27 -0700 Message-ID: <20240930202434.296960-3-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" It seems there's a missing free_netdev in the remove function. Just avoid manual frees and use devm. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 94b37c12f3f7..de4f75ce8d9d 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -601,7 +601,6 @@ ltq_etop_init(struct net_device *dev) =20 err_netdev: unregister_netdev(dev); - free_netdev(dev); err_hw: ltq_etop_hw_exit(dev); return err; @@ -672,7 +671,8 @@ ltq_etop_probe(struct platform_device *pdev) goto err_out; } =20 - dev =3D alloc_etherdev_mq(sizeof(struct ltq_etop_priv), 4); + dev =3D devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv), + 4, 4); if (!dev) { err =3D -ENOMEM; goto err_out; @@ -690,13 +690,13 @@ ltq_etop_probe(struct platform_device *pdev) err =3D device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &p= riv->tx_burst_len); if (err < 0) { dev_err(&pdev->dev, "unable to read tx-burst-length property\n"); - goto err_free; + goto err_out; } =20 err =3D device_property_read_u32(&pdev->dev, "lantiq,rx-burst-length", &p= riv->rx_burst_len); if (err < 0) { dev_err(&pdev->dev, "unable to read rx-burst-length property\n"); - goto err_free; + goto err_out; } =20 for (i =3D 0; i < MAX_DMA_CHAN; i++) { @@ -711,13 +711,11 @@ ltq_etop_probe(struct platform_device *pdev) =20 err =3D register_netdev(dev); if (err) - goto err_free; + goto err_out; =20 platform_set_drvdata(pdev, dev); return 0; =20 -err_free: - free_netdev(dev); err_out: return err; } --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60C3E1A264B; Mon, 30 Sep 2024 20:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727882; cv=none; b=X25FvtlLs9Oa2Im3yUqK8UrvMKuDJdvSMiv8x60+zs9wp+yRjMjxOREPHxIRibo0NDrSJZGtJ1MRf1cUuw9PQinfwVjRuA8ZQgTeYCT3jXoV5QkZXq8kg1jrlonTBMScG8pxWlsQPBETbvBOdlYCD9Q6Ka7ufrSKEGeINNnnw5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727882; c=relaxed/simple; bh=XMZZXO5l6NipfKIdLr6cm7zLTJYjdhmkvhZ5r/61hts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n2ekqyRy0/K33dNp8SIFqRET4MY/MKwAHd2UEfZIajh48XCpn4MHwtL7ecuFr87AKGVcqFHAB2zVAJx0x+UfxIZAWkc1Jgzy7LWNtvKYJeazXBMx8PiyNQCIbxo3XG7SiRmrz3+kszNhAfU2AAIPSKWq6icYWnbj2Qmr/dSaLZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=j7dZgwMk; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j7dZgwMk" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-71b0d9535c0so3343564b3a.2; Mon, 30 Sep 2024 13:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727880; x=1728332680; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rz281jisbQJ7kmb0zJYVwza4XnRAymVyKYSwGboTVyY=; b=j7dZgwMkToubQqm+SjEMvzSaDGzW7FFGpnoj+P9A1YnSWLs0r7RFeCGRQSe/6ylBLe gTZDdqIzwMCJyDI8O9okLuZNyPmxMcRM4RfcpfYCs4kSUl8YSIozOzsgxfX1Jn3/Lfo7 0/3wRsv+TpitSxUh/rfqGsAOi8/KcUU1VCjAE6h0X7nRIDO7k6oIkbXBpdP7O1gqXAkJ QD/QuMkRxOG/4Ued/zgj5PRSeSCMLciTr8AZY5xXmy6Dqn5zI7LdNjXqhRa9ELkvM5iy QRfwhDZE52Co8HfBB0aAPJKIE1N+o2uNzxDjL9IrKDmH/5lzdAbZ1ruypW6GOd82k64L kjMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727880; x=1728332680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rz281jisbQJ7kmb0zJYVwza4XnRAymVyKYSwGboTVyY=; b=B/+5ZzsBV7qCbpoYmLGpBTUeC18H9r5qlntjxQ+iQry6s8WYPmD1FKwQoWykWort3l 5duW10cybA0hqmybs4reNbu08TC4QcUQ0/RKYTHEdk3iTybgZwunb2npQLZy001U3vdW ozgLASEHF2Z5uTlV9cyjGwwy/pUPeJwb3NdL/NlyxZuTvjJNjA91xLUcogADiSX7DF2h 9YELki31DE+B+YXwx+zXUb3HIQ5GRY/dcMEfqH3srx2h6lEZ5NEMihMUFUXi6F1NBKcu XDxyqZTUmbce3JdBiqn41ks07LbjZsjeCkjRM8YmIj91smUHVYG+BfLXRSP14oLuc83R KClA== X-Forwarded-Encrypted: i=1; AJvYcCW4OKcabe1laQDm+6Dxgyjot7SyaNmawSLxiHMdpToD22KMa/fHnujQi4lj/IIFkQ/5HBzbIcUMQ7ifzyg=@vger.kernel.org X-Gm-Message-State: AOJu0YzwmttayKCZfxvbWV7BbcNpAFve0AqTQmDHVQqGt5FDo7/9CpSB pTgeQuy8/qAIHjArtUCMhqmVxQ5MA9pCmMXnrljh673Swzgc2ZeZ+9Qm7FiR X-Google-Smtp-Source: AGHT+IE1qXS4vBd4sepWW0WI4ZrL+y9d7GGuSnH12YEE4QQIVCXGZfHd8YCBRVODg3PZTVcoEPxeww== X-Received: by 2002:a05:6a20:e617:b0:1d4:eb96:8685 with SMTP id adf61e73a8af0-1d4fa815edcmr18935506637.45.1727727880367; Mon, 30 Sep 2024 13:24:40 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:40 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 3/9] net: lantiq_etop: use devm for register_netdev Date: Mon, 30 Sep 2024 13:24:28 -0700 Message-ID: <20240930202434.296960-4-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" This is the last to be created and so must be the first to be freed. Simpler to avoid by using devm. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index de4f75ce8d9d..988f204fd89c 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -587,7 +587,7 @@ ltq_etop_init(struct net_device *dev) =20 err =3D ltq_etop_set_mac_address(dev, &mac); if (err) - goto err_netdev; + goto err_hw; =20 /* Set addr_assign_type here, ltq_etop_set_mac_address would reset it. */ if (random_mac) @@ -596,11 +596,9 @@ ltq_etop_init(struct net_device *dev) ltq_etop_set_multicast_list(dev); err =3D ltq_etop_mdio_init(dev); if (err) - goto err_netdev; + goto err_hw; return 0; =20 -err_netdev: - unregister_netdev(dev); err_hw: ltq_etop_hw_exit(dev); return err; @@ -709,7 +707,7 @@ ltq_etop_probe(struct platform_device *pdev) priv->ch[i].netdev =3D dev; } =20 - err =3D register_netdev(dev); + err =3D devm_register_netdev(&pdev->dev, dev); if (err) goto err_out; =20 @@ -728,7 +726,6 @@ static void ltq_etop_remove(struct platform_device *pde= v) netif_tx_stop_all_queues(dev); ltq_etop_hw_exit(dev); ltq_etop_mdio_cleanup(dev); - unregister_netdev(dev); } } =20 --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F1D81A2C19; Mon, 30 Sep 2024 20:24:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727884; cv=none; b=Do5oftOoDYRsvdJBkmO9ODN0eQua5WQ7QYa9y7EFZdf/cRm/LdnpNO5Dn8I0kTpsHczM7qMW8Sov0J6rQ0pxL+ISqPvVs2Zc7wMPv/oXwrKPQGJXt48wavW5YNduVbpeMdqHTBS2eXIjZ2kzyn37IfRpxUmOXfTT0OM1BQnugNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727884; c=relaxed/simple; bh=UbY7X3xoQwvPKIgeSXpN8TiC94FgYetqZR1cwmZYOHc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=udvRNpt7b7+wcsJGsVjXjQXx/OGeim+NPpdeK6NqkjVPhBg2Vg74uNL9zUF29aofgiC6krxErdiwYxP2SheebJH9aVUX2piJi29TYms/+rOlS8xfYEesOUXOTNtkgmRPKn1EWee3C74H2KbJUDB5PnUIAVmyie/fCDEkLLU2WFs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gC6seBt+; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gC6seBt+" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7e6afa8baeaso4077337a12.3; Mon, 30 Sep 2024 13:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727882; x=1728332682; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dsLesHqpeFTSe8JaIvfnYTIedQG/JoNHMh7rsELIkDM=; b=gC6seBt+6w+yEJJrv2VFmzBkdEIs6Dc4YndtUsOacS/lrqr0dQOC2QUfF+W0EgxGAe BtuXYl2h3ZTBExB94KyYdQzKsvjXMKANDO+/L1HoUZ3YX+bY17jmrWFf8FyLKeuxWPWN OPFLr8oCRYB++6Exg7/UMuNoUEN5BVFQBhHlogk1W1CLh0+ccD/tFMazS2TlkR7+UNDP Cqri1T+J+xOI0LPS32KjMhblb8tbxwrG9R1QWd4pEPqTccPoh/ALYU1x5yHfXKmNXbFX 6+HIVaVPU8mEZ1Bk/x0W/JuRqiUvUN6TOyvuW9tOWQNIH/0bOyCDVwVCB2guys2lhy1X r4Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727882; x=1728332682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dsLesHqpeFTSe8JaIvfnYTIedQG/JoNHMh7rsELIkDM=; b=BjnaAQEgGYKL/zUwdH+qVtY51u4H8WgmCiyp2ldfpoxktj4ZWAsy2QuT4aqwHZOVTv 9LelsCQwmmOr/rzmr7j0VNY763M7ksSLuNnR69kNdsrk07s9TJkiY31gbHxiuhmEv/xM ZW2xNGCCB5NZg6LOlU9QXXGh6b4sA6NMujLCA+Ku+hN+YUahaMdoPkQY2bvND6xnCeVe CwjeUbilr11yDNVIk16nQ8DYOaShxmtSetx/79Jcqdl8crDkb6hZ138rAieoRdW7085V XRo8wzkS9WZasP75NNvbEht2bsLudJ5Ze7jI89lao6L9EaKnxmB2CFJMC6cssPeClAge P+0A== X-Forwarded-Encrypted: i=1; AJvYcCXF6dM48Y9Sp40YHXu19ixqDupBKJZi65nVyy+8OAoMlHG4doEP/ldPToM29MAWx8yjfOOEQ7TBWCNCfN4=@vger.kernel.org X-Gm-Message-State: AOJu0YzourxHEHrfEdEJmXIWqf2dx+SiWq7PUIvEesYzDaDrxtlUFswF brwmiEbsV1cpImzfdv3MLi8/ZdhAK6tFegCVzb1jiyWEDAr0XU/7awPqB6A8 X-Google-Smtp-Source: AGHT+IFU+lltBr7u/6B+O0I+uSlsS396fumfGPvOaQ44allSOv0DiD0W1fNMYLpxn4P/QzsdSZtRiw== X-Received: by 2002:a05:6a21:30cc:b0:1d2:e458:4061 with SMTP id adf61e73a8af0-1d4fa67bfc8mr16540738637.15.1727727881688; Mon, 30 Sep 2024 13:24:41 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:41 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 4/9] net: lantiq_etop: use devm for mdiobus Date: Mon, 30 Sep 2024 13:24:29 -0700 Message-ID: <20240930202434.296960-5-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" Allows removing ltq_etop_mdio_cleanup. Kept the phy_disconnect in the remove function just in case. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 988f204fd89c..d1fcbfd3e255 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -391,7 +391,7 @@ ltq_etop_mdio_init(struct net_device *dev) struct ltq_etop_priv *priv =3D netdev_priv(dev); int err; =20 - priv->mii_bus =3D mdiobus_alloc(); + priv->mii_bus =3D devm_mdiobus_alloc(&dev->dev); if (!priv->mii_bus) { netdev_err(dev, "failed to allocate mii bus\n"); err =3D -ENOMEM; @@ -404,35 +404,21 @@ ltq_etop_mdio_init(struct net_device *dev) priv->mii_bus->name =3D "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); - if (mdiobus_register(priv->mii_bus)) { + if (devm_mdiobus_register(&dev->dev, priv->mii_bus)) { err =3D -ENXIO; - goto err_out_free_mdiobus; + goto err_out; } =20 if (ltq_etop_mdio_probe(dev)) { err =3D -ENXIO; - goto err_out_unregister_bus; + goto err_out; } return 0; =20 -err_out_unregister_bus: - mdiobus_unregister(priv->mii_bus); -err_out_free_mdiobus: - mdiobus_free(priv->mii_bus); err_out: return err; } =20 -static void -ltq_etop_mdio_cleanup(struct net_device *dev) -{ - struct ltq_etop_priv *priv =3D netdev_priv(dev); - - phy_disconnect(dev->phydev); - mdiobus_unregister(priv->mii_bus); - mdiobus_free(priv->mii_bus); -} - static int ltq_etop_open(struct net_device *dev) { @@ -725,7 +711,7 @@ static void ltq_etop_remove(struct platform_device *pde= v) if (dev) { netif_tx_stop_all_queues(dev); ltq_etop_hw_exit(dev); - ltq_etop_mdio_cleanup(dev); + phy_disconnect(dev->phydev); } } =20 --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02F991A3045; Mon, 30 Sep 2024 20:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727885; cv=none; b=eyoJJ6w6b+vGTPSCX9Tpb/erwkgg4GNtVbORrFUGR5nDhyycHaqUm9MH9D+J/fiZAXKQNjGn3Em9p3SdjnzwXby0MMRR/6SXMhTY26MhqA5L5kWUSaUOamsaNYC2lIw8qBEBPsLVQ1tvvhcTIsqM5sW1wkiyWdh9K6XCxq3NHFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727885; c=relaxed/simple; bh=mFqtJiDL5sflOI5u3O6MAOrGomeTiBW3Y2yalRuDuoc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q0+GTOA6E42LtyZ55NvryE2KFJGJMxdZ6L2sdCXsc3ElZ0QJ8GfGN/SW+nb0MnIdRHBpjmBBLE6OAzF22gfQ9qRQgktn8jCATy3gVa0nnRdxCPKm3eB+oPa7sXq2WAUpJxQdU0EFRnLrltdH2eBuj05nqFcs4h/9uEAN3zt5w8Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f4aBf3jo; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f4aBf3jo" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71db62281aeso477435b3a.0; Mon, 30 Sep 2024 13:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727883; x=1728332683; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kx7nkLzY6745YLFrKvN4/52jVdfvHDox57Xox+B513I=; b=f4aBf3joqAGoNxT7lJDUmtXzvC3Z3gadCs2Ws/Dqo60rhH+6yEohInFe2Jp/8WwJFS wYR0z0tGkvYC1FX5f6XDxGoxZA0BIpWa03RCsHL2xsOdjxba+vlxOXODB6idurXmQ1QN WmUe9RW0y0yo4SAgfMg2CzRpsKo3oT2QlfULdqFstp140FIdITm4LTaTfBAtDvI6VZYc WlJYZxWUwZYGESzMh1chb/ktM/eYeIoBbO933gjpE4wOsKbDArde+ecC5CPAyfnPvaMt qtDSmur55+pC65iK3SS8YJlBRQ1XBr5D9rQSZW7m+UnDWxWDzucaHr41d0mvJW0z3vXM yyWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727883; x=1728332683; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kx7nkLzY6745YLFrKvN4/52jVdfvHDox57Xox+B513I=; b=oalUDWb7Ro7+bWTMSB/egCmCBl6He47i57eJNdeD38IxZPQafQG4wBPSQLif9Uraz7 kA56fU3NoDkKcuZFMr+qHb30K0Xaoq3UCipfXLBYbOVBiWtoMB3BTYkBz3xS1R1mDCWD HPcZ7XI756CWWqAvvM3SD74M5/ABgqtEGjKUiG7clfJmIPCOKKnuJVgstlAgBdXhrHVP cugKAsnujhHZXoN9Sa8rp8cMtvRlnaOO+RccrzV026+28ff+HnAr1wyqW8r5sNsJVBeh HyhwaXn0Sp/esvxAK2gQuu6JVKntUL5l5osFG82qn2ImD0++2XeUQVeHjCKWdI2Yj2Qu yFjg== X-Forwarded-Encrypted: i=1; AJvYcCXo5VoI6zkUpmq1Mkkn1lmfkciDeOt1NCK68C1RZcp3yzPeWv7PaTXYGrTDSy5QQnYf/+1X24GilSRNVO8=@vger.kernel.org X-Gm-Message-State: AOJu0YwgsazVtiXXCU4WJnrWBHMoY3j93gCVvMRkzZ3ppwPZUan7DO0F wLJ6L+DxkobG83qxiULcziPV5k6J2vGutWSIUvt+uk1g7jDtNXNfAm9a1oq+ X-Google-Smtp-Source: AGHT+IE/vkE3lBiwPHlw+VZis24UGcCR4ug1sPrb0XzLqQd9oMC9cdPkcZwhI+NCcjfS3WAvx+a1jw== X-Received: by 2002:a05:6a00:8b04:b0:717:92d8:ca5c with SMTP id d2e1a72fcca58-71db79bb1dfmr1065667b3a.3.1727727883035; Mon, 30 Sep 2024 13:24:43 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:42 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 5/9] net: lantiq_etop: move phy_disconnect to stop Date: Mon, 30 Sep 2024 13:24:30 -0700 Message-ID: <20240930202434.296960-6-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" phy is initialized in start, not in probe. Move to stop instead of remove to disconnect it earlier. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index d1fcbfd3e255..9ca8f01585f6 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -447,6 +447,7 @@ ltq_etop_stop(struct net_device *dev) =20 netif_tx_stop_all_queues(dev); phy_stop(dev->phydev); + phy_disconnect(dev->phydev); for (i =3D 0; i < MAX_DMA_CHAN; i++) { struct ltq_etop_chan *ch =3D &priv->ch[i]; =20 @@ -711,7 +712,6 @@ static void ltq_etop_remove(struct platform_device *pde= v) if (dev) { netif_tx_stop_all_queues(dev); ltq_etop_hw_exit(dev); - phy_disconnect(dev->phydev); } } =20 --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50E9F1A38EB; Mon, 30 Sep 2024 20:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727886; cv=none; b=qa95vliD2qxIzIzGobcM3lRg8fXnHCLCEBs6fcPVP5gLc7KC2kXVxMXQVF3PFvu0zBo7G4KwU0bxE1U4gYKVN7gg4WiXIrZV1qZ/veFRJQBvOkTD59fq8VhiiR36mJvyFi9tdmp4q/BiANZjMpW9rZ6+pK8YSMXKH8T7cCAzA+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727886; c=relaxed/simple; bh=BLFruLzi5nr59Es+Q9KpNATJiUxLeOIsnBBJdVewCzw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SZmQ1ba7dbIQGv4NnRerysW2y77bCQVcdE+hvAVPIzkDqkXSNpznE1O9Kc71YCcXqDNyj7wW+t8BY9zewSNTs1llAGJu4KONl2HuWV3cd/l2luRPuPuaXcBBxxjnnAcltE2/jKnXaxg+HWQ18v/vQWCeFseU1i7Lp4MbqzYdLgM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m8uaKi5j; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m8uaKi5j" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7db12af2f31so4003161a12.1; Mon, 30 Sep 2024 13:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727884; x=1728332684; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nHj/lIlzFIU4shuEI1PXkmQf3BW7sLfbfdA5obcdX1E=; b=m8uaKi5jKFKBn0hSrLNuASfFvUsdx75HMj//IBKAgmhxPz7pD3LLLo+O6GPpO/3lOX oJzEXQymTSd5c/EfLUEhTdFLeRZ7692s0jNyZ0w28tbmMgXyAc/5i88KbxJjQfZyl0c+ JnTcSWYuyPZuwAeWiGf2wenCyvdcJCssDevFe9Vmv1j/Qb3Nj7RTaNaKjiISvnYVDicd R5hA2uFZnvSqLg54Pc6lN5LTZ8Misj9RNkxO5Ws+++Nm0H9VLjqgbq2bGh8/VkErmaD8 /IZTfh5hjOODKCjqEhb1tm+/43kd8Pgz6xDgXYZPa6k/lVpIkFRvlcQL67XxetcdIMqT g8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727884; x=1728332684; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nHj/lIlzFIU4shuEI1PXkmQf3BW7sLfbfdA5obcdX1E=; b=lqioYdb0aXDamzKZLk+5zSRvyuf6eiJv795K5htiVlrTM81dQiZAKeb6fPO/oJjnfe QyXK3maRcJW+cSulKcFQfHDGORENFVZ/qiDXK4yurP6Y1IYCFn8t4aYOC3KJisNzB7/v NNEQaAQkGKT4nkOa8TWPmGc9/vZD0qIvrGlrkwB3wpyF209f1red8iUDi6PP0zos15id XeAQnTBbS9cj3gbj6E6vLCUqEBKIeowBk/DvjSIlVtfo62ylHDUPJJPBOA9BO+b5PK/X s7IfItPwnj8IWN9/yFwndeAbMnfTvi1+oOuiZxFZu9kdOygDvMyLIOG+G0Ixx3fUc+ne hT7g== X-Forwarded-Encrypted: i=1; AJvYcCWHa6y7cx8r9wyP9uL2Jh9fmvyYMpYBzszbb+7EXCs2i99VSrJ2+wFp34ke1ZKSrH2Qzx0cdeP09BuV3bo=@vger.kernel.org X-Gm-Message-State: AOJu0Ywre1LiULm1ok0cNeS0hMWk+X+FVRdWY03v2A2Jtp9VY9WyhOXI LzMjhesxM1CbvZBbPLrUiiqgcuqzCbedmwgncvttdY7s0SJQ4wCJTnMJWd+C X-Google-Smtp-Source: AGHT+IHDuqwXABi7sp8QkV124jMxZI5GcRbPKzqCADzQEe2/hjSMGRC6xZmu8PfxNuUPVMPorSIxCQ== X-Received: by 2002:a05:6a21:78e:b0:1d2:eaea:3b4c with SMTP id adf61e73a8af0-1d4fa6c3676mr22894942637.25.1727727884342; Mon, 30 Sep 2024 13:24:44 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:44 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 6/9] net: lantiq_etop: use devm_err_probe Date: Mon, 30 Sep 2024 13:24:31 -0700 Message-ID: <20240930202434.296960-7-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" Also remove pointless gotos that just return as a result of devm conversions. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 61 ++++++++++-------------------- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 9ca8f01585f6..bc97b189785e 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -389,13 +389,11 @@ static int ltq_etop_mdio_init(struct net_device *dev) { struct ltq_etop_priv *priv =3D netdev_priv(dev); - int err; =20 priv->mii_bus =3D devm_mdiobus_alloc(&dev->dev); if (!priv->mii_bus) { netdev_err(dev, "failed to allocate mii bus\n"); - err =3D -ENOMEM; - goto err_out; + return -ENOMEM; } =20 priv->mii_bus->priv =3D dev; @@ -404,19 +402,13 @@ ltq_etop_mdio_init(struct net_device *dev) priv->mii_bus->name =3D "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); - if (devm_mdiobus_register(&dev->dev, priv->mii_bus)) { - err =3D -ENXIO; - goto err_out; - } + if (devm_mdiobus_register(&dev->dev, priv->mii_bus)) + return -ENXIO; =20 - if (ltq_etop_mdio_probe(dev)) { - err =3D -ENXIO; - goto err_out; - } - return 0; + if (ltq_etop_mdio_probe(dev)) + return -ENXIO; =20 -err_out: - return err; + return 0; } =20 static int @@ -634,34 +626,28 @@ ltq_etop_probe(struct platform_device *pdev) =20 res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { - dev_err(&pdev->dev, "failed to get etop resource\n"); - err =3D -ENOENT; - goto err_out; + dev_err(&pdev->dev, "failed to get etop resource"); + return -ENOENT; } =20 res =3D devm_request_mem_region(&pdev->dev, res->start, resource_size(res), dev_name(&pdev->dev)); if (!res) { - dev_err(&pdev->dev, "failed to request etop resource\n"); - err =3D -EBUSY; - goto err_out; + dev_err(&pdev->dev, "failed to request etop resource"); + return -EBUSY; } =20 ltq_etop_membase =3D devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!ltq_etop_membase) { - dev_err(&pdev->dev, "failed to remap etop engine %d\n", - pdev->id); - err =3D -ENOMEM; - goto err_out; + dev_err(&pdev->dev, "failed to remap etop engine %d", pdev->id); + return -ENOMEM; } =20 dev =3D devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv), 4, 4); - if (!dev) { - err =3D -ENOMEM; - goto err_out; - } + if (!dev) + return -ENOMEM; dev->netdev_ops =3D <q_eth_netdev_ops; dev->ethtool_ops =3D <q_etop_ethtool_ops; priv =3D netdev_priv(dev); @@ -673,16 +659,14 @@ ltq_etop_probe(struct platform_device *pdev) SET_NETDEV_DEV(dev, &pdev->dev); =20 err =3D device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &p= riv->tx_burst_len); - if (err < 0) { - dev_err(&pdev->dev, "unable to read tx-burst-length property\n"); - goto err_out; - } + if (err < 0) + return dev_err_probe(&pdev->dev, err, + "unable to read tx-burst-length property"); =20 err =3D device_property_read_u32(&pdev->dev, "lantiq,rx-burst-length", &p= riv->rx_burst_len); - if (err < 0) { - dev_err(&pdev->dev, "unable to read rx-burst-length property\n"); - goto err_out; - } + if (err < 0) + return dev_err_probe(&pdev->dev, err, + "unable to read rx-burst-length property"); =20 for (i =3D 0; i < MAX_DMA_CHAN; i++) { if (IS_TX(i)) @@ -696,13 +680,10 @@ ltq_etop_probe(struct platform_device *pdev) =20 err =3D devm_register_netdev(&pdev->dev, dev); if (err) - goto err_out; + return err; =20 platform_set_drvdata(pdev, dev); return 0; - -err_out: - return err; } =20 static void ltq_etop_remove(struct platform_device *pdev) --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 690E21A3BA9; Mon, 30 Sep 2024 20:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727887; cv=none; b=HxAWBiUzlFhR1TebJJTcrUSi2AXHY3wUHIHy95d7o+vaMpRQgJtHlJk93+o0+c4Psutlhv3rvCBQz4fxyH3Hc9mkE6uudZfEdTwUhI2Q/IIrSbQ6wjajWPF7MawMgKOPz7gVA9tbDObsWEgmEXnzQHyFpiPFpZhUSG+Q+PlvLrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727887; c=relaxed/simple; bh=6LYk1ZXYkRN20IISS7yrx8q2kInlJ1DrccOhvVCu++A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QUqeka4cq32tPiGOG26OwfYVV0x33IAd4jtDO+SjmpCcGv4jDzgDPl1nQsxFXKCgykqffqhpR0RI+/9bHjkR9xvF5U44ZB9hWyiEOmqoy04k0SZFRxrwDxR9In6nM7tohHlrhmmwi3gDkpnpaCyXbyzc1sgE9h202b/kzuz3Nfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iZ+08li+; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iZ+08li+" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-718816be6cbso4103765b3a.1; Mon, 30 Sep 2024 13:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727886; x=1728332686; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UQ644ZQ2SXYReITMnfkt2rkgVzvlQg7D+UukPue1XLU=; b=iZ+08li+8wt+vQUJhSPt/TRIs1M68gBnBiYzBTjOAXh3dcRU7P6/KuvIxtKA/mBGJ9 qGccX5enubfWW+ATRfcrS04RXNoZYh1vR6UIL+4LbLQlvkH4/P/qBz0cQwbArJJB1X5A 2YzISThOWUsnMgdHbdUG6BM2WImTSzRf3EaoKAEgYDfmpKu0L1J6N0RUHqIxOjzfbk7g WpsJ6eai/KAPy6NSQeS3brRWWF5b9l3HsRHDZYElXs8v7AucZCYYVWAb0Mh7m/wSky4P wicuUc5XMBlzczl8iUGwNfRcTnMIxU9nlGVEk/4IlxGva3SabrjguAnB58k5GoLjBCAG kQWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727886; x=1728332686; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UQ644ZQ2SXYReITMnfkt2rkgVzvlQg7D+UukPue1XLU=; b=BzIJaj2Muyz7AXwqA2RZ79o8Ylfm/PAUMPgGK6Q6J2PdYMeRnFfplRmmEGmcY6XACk arITpCXLW3Gp8dLTkmB0xA9r0CQ44ahgvU8Y0tV7bTSY9TgACJMtYszljiKK5yB9w4BW 8iqs5BRuhub9jA8qXiDlxUwAYsRynXQFcjIZUP+GGB+SJCmOdYC6Q4H/b1C7okxi/fWE z6nllEHBIFTIRxdSwr/Y7JgkuL4pCsVa8dmquGP9gez6Gy8gUSPDUoCzOx6EK9poR6wR NAv3fdI7fq5JDE4sdsIGbfLPNaHRbXhR+oaD1u5gcbHgWq91jaAwj7uJ01SJqMwzwBQq GSMg== X-Forwarded-Encrypted: i=1; AJvYcCUaPXSip7hG8cczpqCIJ0bCLajOiYN8bzRP9Cx6YyH0cGYDQNwWwKGE85Fa9deXgbxSl9P/8CB+r2Hj+SE=@vger.kernel.org X-Gm-Message-State: AOJu0Yyjqyf+38nDj6dtwLWvUbPhEZ9wX5tG7IWjxs625rXYL/HBCL/Q swycqagGUjOs1rGc74RgfCKRKK8A6eziFEAm7hc+qqd6asPi3YPigMS49msG X-Google-Smtp-Source: AGHT+IE5UZU6jatcMT96Dhs1v077E3aIIlIFT9w62DmKJYxCLscKbmPULw8epYDHLVEUpCO/nVk+cQ== X-Received: by 2002:a05:6a00:3e1c:b0:718:e062:bd7e with SMTP id d2e1a72fcca58-71b2607a1f8mr18466041b3a.24.1727727885576; Mon, 30 Sep 2024 13:24:45 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:45 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 7/9] net: lantiq_etop: remove struct resource Date: Mon, 30 Sep 2024 13:24:32 -0700 Message-ID: <20240930202434.296960-8-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" All of this can be simplified with devm_platformn_ioremap_resource. No need for extra code. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index bc97b189785e..0cb5d536f351 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -90,7 +90,6 @@ struct ltq_etop_priv { struct net_device *netdev; struct platform_device *pdev; struct ltq_eth_data *pldata; - struct resource *res; =20 struct mii_bus *mii_bus; =20 @@ -620,28 +619,13 @@ ltq_etop_probe(struct platform_device *pdev) { struct net_device *dev; struct ltq_etop_priv *priv; - struct resource *res; int err; int i; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "failed to get etop resource"); - return -ENOENT; - } - - res =3D devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), dev_name(&pdev->dev)); - if (!res) { - dev_err(&pdev->dev, "failed to request etop resource"); - return -EBUSY; - } - - ltq_etop_membase =3D devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!ltq_etop_membase) { + ltq_etop_membase =3D devm_platformn_ioremap_resource(pdev, 0); + if (IS_ERR(ltq_etop_membase)) { dev_err(&pdev->dev, "failed to remap etop engine %d", pdev->id); - return -ENOMEM; + return PTR_ERR(ltq_etop_membase); } =20 dev =3D devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv), @@ -651,7 +635,6 @@ ltq_etop_probe(struct platform_device *pdev) dev->netdev_ops =3D <q_eth_netdev_ops; dev->ethtool_ops =3D <q_etop_ethtool_ops; priv =3D netdev_priv(dev); - priv->res =3D res; priv->pdev =3D pdev; priv->pldata =3D dev_get_platdata(&pdev->dev); priv->netdev =3D dev; --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D6D61A42B5; Mon, 30 Sep 2024 20:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727888; cv=none; b=tVL7Xf09AiR5dntk16ZS5UJNMLwFRQECXa0rpD0JNXVX//4v5k6Z1hiOcZMAYmYIxbEuHMMcCWLop16iAMg0Zvk8pPrbBVnNQma4XYe+jSRMIBXkCw3/jHe6ChqPyc879tnGglkGQugxRr8dDfyhwiK9UZoB9/xFXRxnwJwQd40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727888; c=relaxed/simple; bh=y53djnXZffFQbui/nFPDit97NcI8aKLCR1UhxjfHPVE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DITVriEckTjHXSPhcQtBkKeSsQZQCvwlwpS6k6ij16IcblpSmYyA491Eil7FyV/dEUVUEnOh0hpeiCOvbk5VWe8lDWFN+1cs9SC4YzKNf6fKewNf4wwdyniLKOKpWS+cfN9djxENL4N/rnhLsJ6Fc7VmbJtA0QlyyRj0gHiSdFQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SVNr87aO; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SVNr87aO" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-718e6299191so2525420b3a.2; Mon, 30 Sep 2024 13:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727887; x=1728332687; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Oz4jzOMWaom/iCmcOWzqiV9C3pSZMLIQYWl395YO/Xo=; b=SVNr87aOxZeqpyxtx7zVYmHHNNy1Nq7gI/Fwm61+qVNpOpL1+3yJL3GnJa6D0MX+R0 TWEXehTKBwsMUYWiFDUOpg0mAri1WokjGUI7CvOW9GR6H4BqB9GOoZm2/arwFfAsduvR 1ofs+mO9091aG2yEi6gUe/hRJa1YkIZDKjS3bc9Z8gEIBluojT8iarCrB2qMxTuaxQ2v 5FNkEk9bvO5LeRWuaqhVccuovaHziKWG2NemsKxucDz6a8m5DtX+jhUk5JUt3skmWpWj Uz2ORwaCWPW3CgleBycO1jT3lzlx/b5V2nAaE7u8rnPNx2s9YeHByL6fymgNshYuCvt7 4lkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727887; x=1728332687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Oz4jzOMWaom/iCmcOWzqiV9C3pSZMLIQYWl395YO/Xo=; b=E49qbT8gvszfYonVX2479kOaDtXR0Od3qQ4Dpfkhtf2aL0AZTqAojPdwxCzEzeP1oQ shlyx52H1xXiLwIL4t/Q86+n+QZ+lPxQEZEbU7rVioUSYhIQpDuOUfenpvUQk3p0S53s cO6Yyku4qdG9w4H3FO/aMSOXfvb+r/bKgriuPdW+F671UYd2OIJJbnO6Do1RtOn9h6SA t45vEczXSZi7LvF9zhoN99MPDHw9SjVvT8G0TbJarQJitD5x2gSENrkhgUnVroFTcsls AhL0EqypnHN0qZlu6VRriF7lMKWpGsurR/t+nPgcDPk5EO37FgzWIeopewXc8IUMSrDV EjzQ== X-Forwarded-Encrypted: i=1; AJvYcCWnpVF/IsYHYOEINIdvd+ODYVELq+sYiJzMWRQ69Rn0O6H9cjLNC3mgZhPzrs2aFLR0snKZcW/7RfXbpCg=@vger.kernel.org X-Gm-Message-State: AOJu0YzinS3yNS5ZHvXgMp/5MO6GOsrpuFhbIh64Q5cL3NzALvnIFLv9 pH7tp7YJOBNr35RdxHYywi8bv8gCEpeNLQP9kEtjIGzGts5txXb2xua3losu X-Google-Smtp-Source: AGHT+IGrIrA/eQrujStQXqywOx4ORbtc2YOCSnNbno/NY5h+8n0ULbhFqeZiMS1LVsfstXxG3/N2Kg== X-Received: by 2002:a05:6a00:2e87:b0:714:28eb:ff5d with SMTP id d2e1a72fcca58-71b25f40b29mr20809092b3a.8.1727727886807; Mon, 30 Sep 2024 13:24:46 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:46 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 8/9] net: lantiq_etop: use module_platform_driver_probe Date: Mon, 30 Sep 2024 13:24:33 -0700 Message-ID: <20240930202434.296960-9-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" The explicit init and exit functions don't do anything special. Just use the macro. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 0cb5d536f351..4d8534092667 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -686,24 +686,7 @@ static struct platform_driver ltq_mii_driver =3D { }, }; =20 -static int __init -init_ltq_etop(void) -{ - int ret =3D platform_driver_probe(<q_mii_driver, ltq_etop_probe); - - if (ret) - pr_err("ltq_etop: Error registering platform driver!"); - return ret; -} - -static void __exit -exit_ltq_etop(void) -{ - platform_driver_unregister(<q_mii_driver); -} - -module_init(init_ltq_etop); -module_exit(exit_ltq_etop); +module_platform_driver_probe(<q_mii_driver, ltq_etop_probe); =20 MODULE_AUTHOR("John Crispin "); MODULE_DESCRIPTION("Lantiq SoC ETOP"); --=20 2.46.2 From nobody Thu Nov 28 15:35:01 2024 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E871A1A4E75; Mon, 30 Sep 2024 20:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727890; cv=none; b=CDNcxdmaEI9I1b4HDo1Sq2LMHRASppQuYHmp3YwBo+gk3CWEALpkfoEHIj7TqRix2QIPckeGq+qewdHrGVKx99FDmmo4SqeWeMdo1GCjzeXEjvgW+x58ESFb2HwNiBMQZC2Gc6ohuI4ZV8T/181LFAUrMkdXSpcJ13pASVkc82Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727727890; c=relaxed/simple; bh=8kxk4+UMI3hnxbqNGsCvaPbUoG3GnRoirMjLsMw9SyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DmSuBsNaAINWuMbM7ymLrqZxyUgHqwSI3yciC5wFu7ZM1ERc0/nB0c+BKmxfIa2YGadLVyg1+NsXdUn6GYzwvNH6mHKGaU7F/ijdQkWUfHSiJ1tmV/njbJhhqWOXWCiBJeuZiwCpq/7Ns/URjjUX0zAeFOUJx0EDQwwH0D44p1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CBzEUDLf; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CBzEUDLf" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-7193010d386so4153469b3a.1; Mon, 30 Sep 2024 13:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727727888; x=1728332688; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7A10LIzIoNF81DiF3j7aUIqtKQ+5nYw/hz6Gf8YfUK4=; b=CBzEUDLfcWtNr7x+ERXBdXMqPXKS2x4k3vjEMAOvhFOf3SpxvI2ZVtBNgmNKo5u2QF Rz88FFt3YKhMQX3/N0SP+l33yvNBniZRRtW3buiSenHl2PUbLFdoL7Z2QzLjEtmHAa1q /FdobnyT2NGZ+aByURuTEOiBPYdVBhTLh0LiGcD4iR177hXJ/HapvL3zYfgvS2rbfKR8 JrH+SjfkVfD3RPGuHBIS41dOG1ktp3huJZC9TMoAYz5fZwjyXHEyozw91OZT5DGxXXi+ f2iqWUpPWClJOWEenFYkPc5RE3axgHIiJefe0r+8Ak1zW4r8hhCCt1UFgwMQ96mzwuz8 AFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727727888; x=1728332688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7A10LIzIoNF81DiF3j7aUIqtKQ+5nYw/hz6Gf8YfUK4=; b=WmDs4atXW2GPK0rpBwg2aBbH1+hRil4ekBdyEhBhNXWpB0wYIn+ALMVrjehQpTIQnT UM5vOgCbX8HMqFj+R33v4VVq0CdCamCinJj2WSdnAJimz4sdr8wb93HOScAieOLiSCmc cSODkT/9yDTJVgU0UetitKKfAHinfKySmV8vbUMwW/mZFBjxDPQ9eHZjeJcyr5diBBWr cRa/vQkDkHuVVZI52glLMCubpFkOC6ufxMqYoJm7I28McLHUsnVoFh302ogG2H3sekbo JwFbz7SOvWv4DvONTuG6//9bKKVamNN8R4Hqyx2wswyCA0/8KAlYDillYjfn/T7ON3ZI orgg== X-Forwarded-Encrypted: i=1; AJvYcCWdWN6wR+sd4zi4CuSE70z+DRVJgfeD+KqETjmfNwg4iSnrEGKimTbBLHkrcqYiqcO4f8s0W9A1VYCAZRM=@vger.kernel.org X-Gm-Message-State: AOJu0Ywqh1TNj2Tdim+/hKTpERBKPiywZE1jcCPhaTjR0RGyHMlXpzKb wQtWAx4qacyTcRrJ1GmMfYBdVIBw4pBrlCT0zSaQpDWRWtcH9HJKRtQ5hf/t X-Google-Smtp-Source: AGHT+IEm95g7LstFJamfBtP2W86Y0QwHD/Rz5PJO/tHA3Wlhs9X05sBHz4KIizEpFw7UFS7MzyFz4A== X-Received: by 2002:a05:6a00:9287:b0:718:d5fb:2fc4 with SMTP id d2e1a72fcca58-71b25f38c9emr18662488b3a.9.1727727888010; Mon, 30 Sep 2024 13:24:48 -0700 (PDT) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265160a5sm6670623b3a.103.2024.09.30.13.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 13:24:47 -0700 (PDT) From: Rosen Penev To: netdev@vger.kernel.org Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, olek2@wp.pl, shannon.nelson@amd.com Subject: [PATCH net-next 9/9] net: lantiq_etop: no queue stop in remove Date: Mon, 30 Sep 2024 13:24:34 -0700 Message-ID: <20240930202434.296960-10-rosenp@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com> References: <20240930202434.296960-1-rosenp@gmail.com> 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 Content-Type: text/plain; charset="utf-8" This is already called in stop. No need to call a second time. Signed-off-by: Rosen Penev Reviewed-by: Shannon Nelson --- drivers/net/ethernet/lantiq_etop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lant= iq_etop.c index 4d8534092667..0b5642744f8a 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -673,10 +673,8 @@ static void ltq_etop_remove(struct platform_device *pd= ev) { struct net_device *dev =3D platform_get_drvdata(pdev); =20 - if (dev) { - netif_tx_stop_all_queues(dev); + if (dev) ltq_etop_hw_exit(dev); - } } =20 static struct platform_driver ltq_mii_driver =3D { --=20 2.46.2