summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2022-09-29 10:58:30 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-10-20 12:57:40 +0300
commitdeb8534e8ef3905b5a977486d11d4d36b4f94347 (patch)
treee704403a5d02396bf45dfb129b605801a0bdf7ff
parentacff76fa45b487a9dd7573a6f4d34daca6f0c045 (diff)
downloadlinux-deb8534e8ef3905b5a977486d11d4d36b4f94347.tar.xz
can: gs_usb: gs_can_open(): allow loopback and listen only at the same time
There's no reason why loopback and listen only should not be allowed at the same time. Replace the "else if" by "if" to reflect this in the code. Link: https://lore.kernel.org/all/20221019221016.1659260-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/net/can/usb/gs_usb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index 384847b4a4c9..aa6c84b7db06 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -911,7 +911,8 @@ static int gs_can_open(struct net_device *netdev)
/* flags */
if (ctrlmode & CAN_CTRLMODE_LOOPBACK)
flags |= GS_CAN_MODE_LOOP_BACK;
- else if (ctrlmode & CAN_CTRLMODE_LISTENONLY)
+
+ if (ctrlmode & CAN_CTRLMODE_LISTENONLY)
flags |= GS_CAN_MODE_LISTEN_ONLY;
/* Controller is not allowed to retry TX