mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
can: gs_usb: gs_make_candev(): populate net_device->dev_port
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 commitacff76fa45("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:acff76fa45("can: gs_usb: gs_make_candev(): set netdev->dev_id") Cc: stable@vger.kernel.org Signed-off-by: Celeste Liu <uwu@coelacanthus.name> Link: https://patch.msgid.link/20250930-gs-usb-populate-net_device-dev_port-v1-1-68a065de6937@coelacanthus.name Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
2a27f6a8fb
commit
a12f0bc764
@@ -1245,6 +1245,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
|
|||||||
|
|
||||||
netdev->flags |= IFF_ECHO; /* we support full roundtrip echo */
|
netdev->flags |= IFF_ECHO; /* we support full roundtrip echo */
|
||||||
netdev->dev_id = channel;
|
netdev->dev_id = channel;
|
||||||
|
netdev->dev_port = channel;
|
||||||
|
|
||||||
/* dev setup */
|
/* dev setup */
|
||||||
strcpy(dev->bt_const.name, KBUILD_MODNAME);
|
strcpy(dev->bt_const.name, KBUILD_MODNAME);
|
||||||
|
|||||||
Reference in New Issue
Block a user