X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=module%2Felmcan.c;h=76ec682e9450b6d93d16d199ba426b604a2ce944;hb=e6fb8c97360e26908877df54251c95c768d76761;hp=3d35821fae7d34e0b707d96d8f80146af942ba55;hpb=2d794e4140ae75c06116721b4c60190f12e7e1bf;p=elmcan.git diff --git a/module/elmcan.c b/module/elmcan.c index 3d35821..76ec682 100644 --- a/module/elmcan.c +++ b/module/elmcan.c @@ -37,14 +37,17 @@ #include #include -MODULE_ALIAS_LDISC(N_ELMCAN); +MODULE_ALIAS_LDISC(N_DEVELOPMENT); MODULE_DESCRIPTION("ELM327 based CAN interface"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Max Staudt "); -/* Line discipline ID number */ -#ifndef N_ELMCAN -#define N_ELMCAN 29 +/* Line discipline ID number. + * N_DEVELOPMENT will likely be defined from Linux 5.18 onwards: + * https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/commit/?h=tty-next&id=c2faf737abfb10f88f2d2612d573e9edc3c42c37 + */ +#ifndef N_DEVELOPMENT +#define N_DEVELOPMENT 29 #endif #define ELM327_NAPI_WEIGHT 4 @@ -1249,7 +1252,7 @@ static int elmcan_ldisc_ioctl(struct tty_struct *tty, static struct tty_ldisc_ops elmcan_ldisc = { .owner = THIS_MODULE, .name = "elmcan", - .num = N_ELMCAN, + .num = N_DEVELOPMENT, .receive_buf = elmcan_ldisc_rx, .write_wakeup = elmcan_ldisc_tx_wakeup, .open = elmcan_ldisc_open, @@ -1263,7 +1266,7 @@ static int __init elmcan_init(void) int status; #if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0) - status = tty_register_ldisc(N_ELMCAN, &elmcan_ldisc); + status = tty_register_ldisc(N_DEVELOPMENT, &elmcan_ldisc); #else status = tty_register_ldisc(&elmcan_ldisc); #endif @@ -1281,7 +1284,7 @@ static void __exit elmcan_exit(void) #if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0) int status; - status = tty_unregister_ldisc(N_ELMCAN); + status = tty_unregister_ldisc(N_DEVELOPMENT); if (status) pr_err("Can't unregister line discipline (error: %d)\n", status);