diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-04 15:40:22 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-31 20:55:15 +0100 |
commit | 49cb5c0e0cb26e9f39445d8b5aa5c50ba9451cdd (patch) | |
tree | 643795318f2e0c67b65f665f78651caf4bdbae50 | |
parent | 57a59b9ef58f3422f9d9f2cf7631da1727686991 (diff) | |
download | kernel-common-49cb5c0e0cb26e9f39445d8b5aa5c50ba9451cdd.tar.gz kernel-common-49cb5c0e0cb26e9f39445d8b5aa5c50ba9451cdd.tar.bz2 kernel-common-49cb5c0e0cb26e9f39445d8b5aa5c50ba9451cdd.zip |
can: dev: sort can_changelink() by IFLA_CAN_*
This patch sorts the handling of data[IFLA_CAN_*] by IFLA_CAN_*.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/dev.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 8d6f7212ae22..bda1888cae9a 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -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) |