From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 A1C23374E79 for ; Tue, 3 Mar 2026 14:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772549575; cv=none; b=EAcYp9RbS9lJjboQY0ersenBtXpOQp81zLqGfKhqystEEJNFIccqhC/fpbNNFP92pT1uk/mNf4el/QmXqZDS7FLLpFkTrpb+JALCa11G4D5S7W1uUylq+OD2F9PdSJRfZZbg0OJRnY9zs5FlaUa5RrFs7ni+0xYnNQM0I/qBpYc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772549575; c=relaxed/simple; bh=pWDmYaf8U+BiAjsMr6gFWstsk8KBcqbuJ7+Y7BINxyk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E6YfwX3gWuj33z4jMQ18/4TLAtcGEr/rWRo7t9ItsIi9fy+X/rN+s6th0+U7LyQjcRYmt5AKR5VsubXrZeDBXUQMGiFBzNJgeAzqSjoEniGk+jfjW0JSiWK+uFoQi/EO+aZ4ctkLzF6wS0erlGpJDd9qZYS5gbfolZOsg6mWRRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=D/fPMy3W; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=tffnX/dL; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="D/fPMy3W"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="tffnX/dL" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 425B65BE16; Tue, 3 Mar 2026 14:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1772549572; h=from:from:reply-to: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=Vlk/R2Ffl6mCZS3j4Gk8mUnFs2D54aal8KVVQu3vvwU=; b=D/fPMy3WDUAxbKH1dHS1JHiMr0TKpquA+Q5pDxNbZ1y+YI121ZqGjHA0tQUQLtGNM7gnxT ortXdAkgEw8B2rtyGwcr2/fadLitgZQRJ5EJJyK2L1oypBDjUOa5rMDYQAdMEJ1NfawUwL 7IvnUNPoa87z7/HUeH1KSrEKo4hSBRQ= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1772549571; h=from:from:reply-to: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=Vlk/R2Ffl6mCZS3j4Gk8mUnFs2D54aal8KVVQu3vvwU=; b=tffnX/dLMhIG8hSwUMdJIhRBB5ASKq4sz5WQuiqYYkRJ0oX8B1TfkdtFF1A+pqrB+2Ysuh QBdly81qZZDPkdl4SQB+PdR1zlhA4N9DIx54BollY/qfKG4PEsH/YT/zV4Wwk7TR4MJCuh eFkEF6RP8GQV0SwGTt5CLBF+M/fMAeI= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 19CD93EA6E; Tue, 3 Mar 2026 14:52:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8IEuBcP1pmmPKQAAD6G6ig (envelope-from ); Tue, 03 Mar 2026 14:52:51 +0000 From: Oliver Neukum To: andrew@lunn.ch, bjorn@mork.no, netdev@vger.kernel.org Cc: Oliver Neukum Subject: [RFCv2 04/13] net: usb: usbnet: add access helper for private data Date: Tue, 3 Mar 2026 15:50:24 +0100 Message-ID: <20260303145242.1377514-4-oneukum@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260303145242.1377514-1-oneukum@suse.com> References: <20260303145242.1377514-1-oneukum@suse.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO Drivers should not need to go for the internals of usbnet to find their private data. Signed-off-by: Oliver Neukum --- include/linux/usb/usbnet.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index b0e84896e6ac..4a97845be62c 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -206,6 +206,11 @@ extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype, extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, u16 value, u16 index, const void *data, u16 size); +static inline void *usbnet_priv(struct usbnet *dev) +{ + return (void *)dev->data; +} + /* Drivers that reuse some of the standard USB CDC infrastructure * (notably, using multiple interfaces according to the CDC * union descriptor) get some helper code. -- 2.53.0