]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: wwan: core: split port creation and registration
authorSergey Ryazanov <ryazanov.s.a@gmail.com>
Mon, 26 Jan 2026 06:21:53 +0000 (14:21 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 31 Jan 2026 02:26:59 +0000 (18:26 -0800)
commitdccd23a673ca09505b53fe10bccdd0421ad6cf80
tree6115c10186acd9b83472e2702100bc9bc8c8c2a7
parentb9879ba78dca3da61448b52751551da2bb52469c
net: wwan: core: split port creation and registration

Upcoming GNSS (NMEA) port type support requires exporting it via the
GNSS subsystem. On another hand, we still need to do basic WWAN core
work: find or allocate the WWAN device, make it the port parent, etc. To
reuse as much code as possible, split the port creation function into
the registration of a regular WWAN port device, and basic port struct
initialization.

To be able to use put_device() uniformly, break the device_register()
call into device_initialize() and device_add() and call device
initialization earlier.

While at it, fix a minor number leak upon WWAN port registration
failure.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Link: https://patch.msgid.link/20260126062158.308598-4-slark_xiao@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wwan/wwan_core.c