Skip to content

Commit 52eb720

Browse files
CoelacanthusHexgregkh
authored andcommitted
can: gs_usb: gs_make_candev(): populate net_device->dev_port
commit a12f0bc upstream. The gs_usb driver supports USB devices with more than 1 CAN channel. In old kernel before 3.15, it uses net_device->dev_id to distinguish different channel in userspace, which was done in commit acff76f ("can: gs_usb: gs_make_candev(): set netdev->dev_id"). But since 3.15, the correct way is populating net_device->dev_port. And according to documentation, if network device support multiple interface, lack of net_device->dev_port SHALL be treated as a bug. Fixes: acff76f ("can: gs_usb: gs_make_candev(): set netdev->dev_id") Cc: [email protected] Signed-off-by: Celeste Liu <[email protected]> Link: https://patch.msgid.link/20250930-gs-usb-populate-net_device-dev_port-v1-1-68a065de6937@coelacanthus.name Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3fdcfd9 commit 52eb720

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/can/usb/gs_usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
12461246

12471247
netdev->flags |= IFF_ECHO; /* we support full roundtrip echo */
12481248
netdev->dev_id = channel;
1249+
netdev->dev_port = channel;
12491250

12501251
/* dev setup */
12511252
strcpy(dev->bt_const.name, KBUILD_MODNAME);

0 commit comments

Comments
 (0)