]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
can: gs_usb: gs_make_candev(): call SET_NETDEV_DEV() after handling all bt_const...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 Nov 2020 12:03:53 +0000 (13:03 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 10 Mar 2022 08:49:14 +0000 (09:49 +0100)
This patch moves the call to SET_NETDEV_DEV() after all handling
(including cleanup) of the bt_const->feature is done. This looks more
consistent.

Link: https://lore.kernel.org/all/20220309124132.291861-8-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/gs_usb.c

index 7ba492150cdbcbc8ad6548a55772b8c0c51321da..fa370549bd9e4f0478592f419909325ea14aa0e8 100644 (file)
@@ -849,14 +849,14 @@ static struct gs_can *gs_make_candev(unsigned int channel,
        if (feature & GS_CAN_FEATURE_ONE_SHOT)
                dev->can.ctrlmode_supported |= CAN_CTRLMODE_ONE_SHOT;
 
-       SET_NETDEV_DEV(netdev, &intf->dev);
-
        if (le32_to_cpu(dconf->sw_version) > 1)
                if (feature & GS_CAN_FEATURE_IDENTIFY)
                        netdev->ethtool_ops = &gs_usb_ethtool_ops;
 
        kfree(bt_const);
 
+       SET_NETDEV_DEV(netdev, &intf->dev);
+
        rc = register_candev(dev->netdev);
        if (rc) {
                free_candev(dev->netdev);