Skip to content

Commit

Permalink
tty: n_gsm: name gsm tty device minors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dstarke-siemens authored and intel-lab-lkp committed Aug 22, 2022
1 parent 4c179f4 commit 10f5609
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 10f5609

Please sign in to comment.