All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH v3 1/7] can: gs_usb: gs_can_open(): allow loopback and listen only at the same time
Date: Thu, 20 Oct 2022 00:10:10 +0200	[thread overview]
Message-ID: <20221019221016.1659260-2-mkl@pengutronix.de> (raw)
In-Reply-To: <20221019221016.1659260-1-mkl@pengutronix.de>

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/20221019213035.1607752-2-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/gs_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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
-- 
2.35.1



  reply	other threads:[~2022-10-19 22:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 22:10 [PATCH v3 0/7] can: gs_usb: new features: GS_CAN_FEATURE_GET_STATE, GS_CAN_FEATURE_BERR_REPORTING Marc Kleine-Budde
2022-10-19 22:10 ` Marc Kleine-Budde [this message]
2022-10-19 22:10 ` [PATCH v3 2/7] can: gs_usb: gs_can_open(): sort checks for ctrlmode Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 3/7] can: gs_usb: gs_can_open(): merge setting of timestamp flags and init Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 4/7] can: gs_usb: document GS_CAN_FEATURE_BERR_REPORTING Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 5/7] can: gs_usb: add ability to enable / disable berr reporting Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 6/7] can: gs_usb: document GS_CAN_FEATURE_GET_STATE Marc Kleine-Budde
2022-10-19 22:10 ` [PATCH v3 7/7] can: gs_usb: add support for reading error counters Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221019221016.1659260-2-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.