All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/11] USB: serial: digi_acceleport: add oob port helper
Date: Wed, 10 Jun 2026 15:22:25 +0200	[thread overview]
Message-ID: <20260610132232.356139-5-johan@kernel.org> (raw)
In-Reply-To: <20260610132232.356139-1-johan@kernel.org>

Add a helper function for retrieving the OOB port to replace two
convoluted expressions.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/digi_acceleport.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 7195a63da8a1..80b8863b7942 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -350,6 +350,13 @@ __releases(lock)
 	return timeout;
 }
 
+static struct usb_serial_port *digi_get_oob_port(struct usb_serial *serial)
+{
+	struct digi_serial *serial_priv = usb_get_serial_data(serial);
+
+	return serial_priv->ds_oob_port;
+}
+
 /*
  *  Digi Write OOB Command
  *
@@ -366,7 +373,7 @@ static int digi_write_oob_command(struct usb_serial_port *port,
 {
 	int ret = 0;
 	int len;
-	struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port;
+	struct usb_serial_port *oob_port = digi_get_oob_port(port->serial);
 	struct digi_port *oob_priv = usb_get_serial_port_data(oob_port);
 	unsigned long flags;
 
@@ -504,7 +511,7 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
 
 	int ret;
 	struct digi_port *port_priv = usb_get_serial_port_data(port);
-	struct usb_serial_port *oob_port = (struct usb_serial_port *) ((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port;
+	struct usb_serial_port *oob_port = digi_get_oob_port(port->serial);
 	struct digi_port *oob_priv = usb_get_serial_port_data(oob_port);
 	unsigned char *data = oob_port->write_urb->transfer_buffer;
 	unsigned long flags;
-- 
2.53.0


  parent reply	other threads:[~2026-06-10 13:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 13:22 [PATCH 00/11] USB: serial: digi_acceleport: registration fix and cleanups Johan Hovold
2026-06-10 13:22 ` [PATCH 01/11] USB: serial: digi_acceleport: fix port registration order Johan Hovold
2026-06-10 13:22 ` [PATCH 02/11] USB: serial: digi_acceleport: drop unused wait queue Johan Hovold
2026-06-10 13:22 ` [PATCH 03/11] USB: serial: digi_acceleport: always stop write urb on close Johan Hovold
2026-06-10 13:22 ` Johan Hovold [this message]
2026-06-10 13:22 ` [PATCH 05/11] USB: serial: digi_acceleport: clean up declarations and whitespace Johan Hovold
2026-06-10 13:22 ` [PATCH 06/11] USB: serial: digi_acceleport: drop redundant driver data sanity checks Johan Hovold
2026-06-10 13:22 ` [PATCH 07/11] USB: serial: digi_acceleport: stop OOB I/O when not in use Johan Hovold
2026-06-10 13:22 ` [PATCH 08/11] USB: serial: digi_acceleport: drop unused in-buf define Johan Hovold
2026-06-10 13:22 ` [PATCH 09/11] USB: serial: digi_acceleport: clean up xfer buf length expression Johan Hovold
2026-06-10 13:22 ` [PATCH 10/11] USB: serial: digi_acceleport: clean up write completion Johan Hovold
2026-06-10 13:22 ` [PATCH 11/11] USB: serial: digi_acceleport: clean up inb command submission Johan Hovold

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=20260610132232.356139-5-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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.