can: dev: sort can_changelink() by IFLA_CAN_*
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 4 Oct 2013 13:40:22 +0000 (15:40 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 31 Oct 2013 19:55:15 +0000 (20:55 +0100)
This patch sorts the handling of data[IFLA_CAN_*] by IFLA_CAN_*.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c

index 8d6f7212ae22cc082999d8b76ae47a853d9aa173..bda1888cae9a9baa3034499c222e50cd8778958a 100644 (file)
@@ -645,19 +645,6 @@ static int can_changelink(struct net_device *dev,
        /* We need synchronization with dev->stop() */
        ASSERT_RTNL();
 
-       if (data[IFLA_CAN_CTRLMODE]) {
-               struct can_ctrlmode *cm;
-
-               /* Do not allow changing controller mode while running */
-               if (dev->flags & IFF_UP)
-                       return -EBUSY;
-               cm = nla_data(data[IFLA_CAN_CTRLMODE]);
-               if (cm->flags & ~priv->ctrlmode_supported)
-                       return -EOPNOTSUPP;
-               priv->ctrlmode &= ~cm->mask;
-               priv->ctrlmode |= cm->flags;
-       }
-
        if (data[IFLA_CAN_BITTIMING]) {
                struct can_bittiming bt;
 
@@ -680,6 +667,19 @@ static int can_changelink(struct net_device *dev,
                }
        }
 
+       if (data[IFLA_CAN_CTRLMODE]) {
+               struct can_ctrlmode *cm;
+
+               /* Do not allow changing controller mode while running */
+               if (dev->flags & IFF_UP)
+                       return -EBUSY;
+               cm = nla_data(data[IFLA_CAN_CTRLMODE]);
+               if (cm->flags & ~priv->ctrlmode_supported)
+                       return -EOPNOTSUPP;
+               priv->ctrlmode &= ~cm->mask;
+               priv->ctrlmode |= cm->flags;
+       }
+
        if (data[IFLA_CAN_RESTART_MS]) {
                /* Do not allow changing restart delay while running */
                if (dev->flags & IFF_UP)