Skip to content

Commit

Permalink
can: gs_usb: gs_make_candev(): call SET_NETDEV_DEV() after handling a…
Browse files Browse the repository at this point in the history
…ll bt_const->feature

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>
  • Loading branch information
Marc Kleine-Budde committed Mar 10, 2022
1 parent c1ee726 commit e0d2575
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e0d2575

Please sign in to comment.