aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ti-st/st_core.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-05-05 11:19:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-13 16:57:16 +0200
commitf81ee8b8b8421dc06d13f197bb53191559cc51da (patch)
tree1034c668915cd8a499a186e25197783ff5f9b983 /drivers/misc/ti-st/st_core.c
parentn_gsm: use goto-failpaths in gsm_init (diff)
downloadlinux-dev-f81ee8b8b8421dc06d13f197bb53191559cc51da.tar.xz
linux-dev-f81ee8b8b8421dc06d13f197bb53191559cc51da.zip
tty: make tty_ldisc_ops a param in tty_unregister_ldisc
Make tty_unregister_ldisc symmetric to tty_register_ldisc by accepting struct tty_ldisc_ops as a parameter instead of ldisc number. This avoids checking of the ldisc number bounds in tty_unregister_ldisc. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@reisers.ca> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Johan Hedberg <johan.hedberg@gmail.com> Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Rodolfo Giometti <giometti@enneenne.com> Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Link: https://lore.kernel.org/r/20210505091928.22010-17-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/misc/ti-st/st_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index a4f5d02940c7..174ae8e52805 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -872,7 +872,7 @@ int st_core_init(struct st_data_s **core_data)
st_gdata = kzalloc(sizeof(struct st_data_s), GFP_KERNEL);
if (!st_gdata) {
pr_err("memory allocation failed");
- err = tty_unregister_ldisc(N_TI_WL);
+ err = tty_unregister_ldisc(&st_ldisc_ops);
if (err)
pr_err("unable to un-register ldisc %ld", err);
err = -ENOMEM;
@@ -892,7 +892,7 @@ int st_core_init(struct st_data_s **core_data)
if (err) {
pr_err("error during st_ll initialization(%ld)", err);
kfree(st_gdata);
- err = tty_unregister_ldisc(N_TI_WL);
+ err = tty_unregister_ldisc(&st_ldisc_ops);
if (err)
pr_err("unable to un-register ldisc");
return err;
@@ -919,7 +919,7 @@ void st_core_exit(struct st_data_s *st_gdata)
kfree_skb(st_gdata->rx_skb);
kfree_skb(st_gdata->tx_skb);
/* TTY ldisc cleanup */
- err = tty_unregister_ldisc(N_TI_WL);
+ err = tty_unregister_ldisc(&st_ldisc_ops);
if (err)
pr_err("unable to un-register ldisc %ld", err);
/* free the global data pointer */