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: [RFCv3 07/13] net: usb: use cdc_state in struct usbnet
Date: Mon,  9 Mar 2026 17:53:30 +0100	[thread overview]
Message-ID: <20260309165614.861929-7-oneukum@suse.com> (raw)
In-Reply-To: <20260309165614.861929-1-oneukum@suse.com>

Remove private copies as now a central state can be used.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/cdc_ether.c  | 6 +++---
 drivers/net/usb/rndis_host.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index c24c14702f4b..dafc2462be98 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -85,7 +85,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 	u8				*buf = intf->cur_altsetting->extra;
 	int				len = intf->cur_altsetting->extralen;
 	struct usb_interface_descriptor	*d;
-	struct cdc_state		*info = usbnet_priv(dev);
+	struct cdc_state		*info = &dev->cdc;
 	int				status;
 	int				rndis;
 	bool				android_rndis_quirk = false;
@@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
 
 void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
 {
-	struct cdc_state		*info = usbnet_priv(dev);
+	struct cdc_state		*info = &dev->cdc;
 	struct usb_driver		*driver = driver_of(intf);
 
 	/* combined interface - nothing  to do */
@@ -365,7 +365,7 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
 int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int				status;
-	struct cdc_state		*info = usbnet_priv(dev);
+	struct cdc_state		*info = &dev->cdc;
 
 	status = usbnet_ether_cdc_bind(dev, intf);
 	if (status < 0)
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 7b3739b29c8f..6aed29dfa021 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -57,7 +57,7 @@ EXPORT_SYMBOL_GPL(rndis_status);
 static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg,
 				int buflen)
 {
-	struct cdc_state *info = (void *)&dev->data;
+	struct cdc_state *info = &dev->cdc;
 	struct device *udev = &info->control->dev;
 
 	if (dev->driver_info->indication) {
@@ -90,7 +90,7 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg,
  */
 int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
 {
-	struct cdc_state	*info = (void *) &dev->data;
+	struct cdc_state	*info = &dev->cdc;
 	struct usb_cdc_notification notification;
 	int			master_ifnum;
 	int			retval;
@@ -290,7 +290,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
 {
 	int			retval;
 	struct net_device	*net = dev->net;
-	struct cdc_state	*info = (void *) &dev->data;
+	struct cdc_state	*info = &dev->cdc;
 	union {
 		void			*buf;
 		struct rndis_msg_hdr	*header;
-- 
2.53.0


  parent reply	other threads:[~2026-03-09 16:56 UTC|newest]

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

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=20260309165614.861929-7-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