All of lore.kernel.org
 help / color / mirror / Atom feed
From: "D. Starke" <daniel.starke@siemens.com>
To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
	jirislaby@kernel.org
Cc: linux-kernel@vger.kernel.org, Daniel Starke <daniel.starke@siemens.com>
Subject: [PATCH v2 2/6] tty: n_gsm: name gsm tty device minors
Date: Tue, 23 Aug 2022 08:22:55 +0200	[thread overview]
Message-ID: <20220823062259.4754-2-daniel.starke@siemens.com> (raw)
In-Reply-To: <20220823062259.4754-1-daniel.starke@siemens.com>

From: Daniel Starke <daniel.starke@siemens.com>

Add a macro which defines the possible number of virtual devices for n_gsm
to improve code readability.

Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
---
 drivers/tty/n_gsm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

No changes since v1.

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5bf09d129357..ed399d57b197 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -164,6 +164,9 @@ struct gsm_dlci {
 	struct net_device *net; /* network interface, if created */
 };
 
+/* Total number of supported devices */
+#define GSM_TTY_MINORS		256
+
 /* DLCI 0, 62/63 are special or reserved see gsmtty_open */
 
 #define NUM_DLCI		64
@@ -3748,7 +3751,7 @@ static int __init gsm_init(void)
 		return status;
 	}
 
-	gsm_tty_driver = tty_alloc_driver(256, TTY_DRIVER_REAL_RAW |
+	gsm_tty_driver = tty_alloc_driver(GSM_TTY_MINORS, TTY_DRIVER_REAL_RAW |
 			TTY_DRIVER_DYNAMIC_DEV | TTY_DRIVER_HARDWARE_BREAK);
 	if (IS_ERR(gsm_tty_driver)) {
 		pr_err("gsm_init: tty allocation failed.\n");
-- 
2.34.1


  reply	other threads:[~2022-08-23  6:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23  6:22 [PATCH v2 1/6] tty: n_gsm: add enumeration for gsm encodings D. Starke
2022-08-23  6:22 ` D. Starke [this message]
2022-08-30  6:49   ` [PATCH v2 2/6] tty: n_gsm: name gsm tty device minors Jiri Slaby
2022-08-23  6:22 ` [PATCH v2 3/6] tty: n_gsm: replace use of gsm_read_ea() with gsm_read_ea_val() D. Starke
2022-08-30  6:55   ` Jiri Slaby
2022-08-23  6:22 ` [PATCH v2 4/6] tty: n_gsm: introduce gsm_control_command() function D. Starke
2022-08-30  6:59   ` Jiri Slaby
2022-08-23  6:22 ` [PATCH v2 5/6] tty: n_gsm: name the debug bits D. Starke
2022-08-30  7:00   ` Jiri Slaby
2022-08-23  6:22 ` [PATCH v2 6/6] tty: n_gsm: add debug bit for user payload D. Starke
2022-08-30  6:49 ` [PATCH v2 1/6] tty: n_gsm: add enumeration for gsm encodings Jiri Slaby

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=20220823062259.4754-2-daniel.starke@siemens.com \
    --to=daniel.starke@siemens.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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.