public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: andrew@lunn.ch, bjorn@mork.no, netdev@vger.kernel.org
Cc: Oliver Neukum <oneukum@suse.com>
Subject: [RFCv2 13/13] net: usb: lg-vl600: use dynamic private allocation
Date: Tue,  3 Mar 2026 15:50:33 +0100	[thread overview]
Message-ID: <20260303145242.1377514-13-oneukum@suse.com> (raw)
In-Reply-To: <20260303145242.1377514-1-oneukum@suse.com>

The old style private room was too small for lg-vl600
With dynamic allocation that factor is gone.
Remove handling private allocations in the driver.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/lg-vl600.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c
index c4ad2d9f6f4f..02949e78e5d6 100644
--- a/drivers/net/usb/lg-vl600.c
+++ b/drivers/net/usb/lg-vl600.c
@@ -56,18 +56,10 @@ struct vl600_state {
 static int vl600_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int ret;
-	struct vl600_state *s = kzalloc_obj(struct vl600_state);
-
-	if (!s)
-		return -ENOMEM;
 
 	ret = usbnet_cdc_bind(dev, intf);
-	if (ret) {
-		kfree(s);
+	if (ret)
 		return ret;
-	}
-
-	dev->driver_priv = s;
 
 	/* ARP packets don't go through, but they're also of no use.  The
 	 * subnet has only two hosts anyway: us and the gateway / DHCP
@@ -85,10 +77,9 @@ static int vl600_bind(struct usbnet *dev, struct usb_interface *intf)
 
 static void vl600_unbind(struct usbnet *dev, struct usb_interface *intf)
 {
-	struct vl600_state *s = dev->driver_priv;
+	struct vl600_state *s = usbnet_priv(dev);
 
 	dev_kfree_skb(s->current_rx_buf);
-	kfree(s);
 
 	return usbnet_cdc_unbind(dev, intf);
 }
@@ -101,7 +92,7 @@ static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 	int packet_len, count;
 	struct sk_buff *buf = skb;
 	struct sk_buff *clone;
-	struct vl600_state *s = dev->driver_priv;
+	struct vl600_state *s = usbnet_priv(dev);
 
 	/* Frame lengths are generally 4B multiplies but every couple of
 	 * hours there's an odd number of bytes sized yet correct frame,
@@ -306,6 +297,7 @@ static const struct driver_info	vl600_info = {
 	.status		= usbnet_cdc_status,
 	.rx_fixup	= vl600_rx_fixup,
 	.tx_fixup	= vl600_tx_fixup,
+	.required_room	= sizeof(struct vl600_state),
 };
 
 static const struct usb_device_id products[] = {
-- 
2.53.0


      parent reply	other threads:[~2026-03-03 14:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 14:50 [RFCv2 01/13] net: usb: usbnet: use proper ep number macros Oliver Neukum
2026-03-03 14:50 ` [RFCv2 02/13] net: usb: move updating filter and status from cdc to usbnet Oliver Neukum
2026-03-03 14:50 ` [RFCv2 03/13] net: usb: centralize usbnet_cdc_zte_rx_fixup in usbnet Oliver Neukum
2026-03-03 14:50 ` [RFCv2 04/13] net: usb: usbnet: add access helper for private data Oliver Neukum
2026-03-03 14:50 ` [RFCv2 05/13] net: usb: use accessor helper for usbnet " Oliver Neukum
2026-03-03 14:50 ` [RFCv2 06/13] net: usb: usbnet: add cdc_state to struct usbnet Oliver Neukum
2026-03-03 14:50 ` [RFCv2 07/13] net: usb: use cdc_state in " Oliver Neukum
2026-03-03 14:50 ` [RFCv2 08/13] net: usb: usbnet: allow drivers to specify private space needed Oliver Neukum
2026-03-03 14:50 ` [RFCv2 09/13] net: usb: use allocation on demand for usbnet Oliver Neukum
2026-03-03 14:50 ` [RFCv2 10/13] net: usb: sierra_net: use dynamic private allocation Oliver Neukum
2026-03-03 14:50 ` [RFCv2 11/13] net: usb: cdc_ncm: " Oliver Neukum
2026-03-03 14:50 ` [RFCv2 12/13] net: usb: smsc95xx: " Oliver Neukum
2026-03-03 14:50 ` Oliver Neukum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260303145242.1377514-13-oneukum@suse.com \
    --to=oneukum@suse.com \
    --cc=andrew@lunn.ch \
    --cc=bjorn@mork.no \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox