Commit 7f30c19c authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

tty: hvc: Make hvc_remove() return no value

The function hvc_remove() returns zero unconditionally. Make it return
void instead to make it obvious that the caller doesn't need to do any
error handling. Accordingly drop the error handling from
hvc_opal_remove().
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Link: https://lore.kernel.org/r/20231105214406.3765906-5-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9c8c269b
...@@ -976,7 +976,7 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data, ...@@ -976,7 +976,7 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
} }
EXPORT_SYMBOL_GPL(hvc_alloc); EXPORT_SYMBOL_GPL(hvc_alloc);
int hvc_remove(struct hvc_struct *hp) void hvc_remove(struct hvc_struct *hp)
{ {
unsigned long flags; unsigned long flags;
struct tty_struct *tty; struct tty_struct *tty;
...@@ -1010,7 +1010,6 @@ int hvc_remove(struct hvc_struct *hp) ...@@ -1010,7 +1010,6 @@ int hvc_remove(struct hvc_struct *hp)
tty_vhangup(tty); tty_vhangup(tty);
tty_kref_put(tty); tty_kref_put(tty);
} }
return 0;
} }
EXPORT_SYMBOL_GPL(hvc_remove); EXPORT_SYMBOL_GPL(hvc_remove);
......
...@@ -77,7 +77,7 @@ extern int hvc_instantiate(uint32_t vtermno, int index, ...@@ -77,7 +77,7 @@ extern int hvc_instantiate(uint32_t vtermno, int index,
extern struct hvc_struct * hvc_alloc(uint32_t vtermno, int data, extern struct hvc_struct * hvc_alloc(uint32_t vtermno, int data,
const struct hv_ops *ops, int outbuf_size); const struct hv_ops *ops, int outbuf_size);
/* remove a vterm from hvc tty operation (module_exit or hotplug remove) */ /* remove a vterm from hvc tty operation (module_exit or hotplug remove) */
extern int hvc_remove(struct hvc_struct *hp); extern void hvc_remove(struct hvc_struct *hp);
/* data available */ /* data available */
int hvc_poll(struct hvc_struct *hp); int hvc_poll(struct hvc_struct *hp);
......
...@@ -235,16 +235,15 @@ static int hvc_opal_probe(struct platform_device *dev) ...@@ -235,16 +235,15 @@ static int hvc_opal_probe(struct platform_device *dev)
static int hvc_opal_remove(struct platform_device *dev) static int hvc_opal_remove(struct platform_device *dev)
{ {
struct hvc_struct *hp = dev_get_drvdata(&dev->dev); struct hvc_struct *hp = dev_get_drvdata(&dev->dev);
int rc, termno; int termno;
termno = hp->vtermno; termno = hp->vtermno;
rc = hvc_remove(hp); hvc_remove(hp);
if (rc == 0) { if (hvc_opal_privs[termno] != &hvc_opal_boot_priv)
if (hvc_opal_privs[termno] != &hvc_opal_boot_priv) kfree(hvc_opal_privs[termno]);
kfree(hvc_opal_privs[termno]); hvc_opal_privs[termno] = NULL;
hvc_opal_privs[termno] = NULL;
} return 0;
return rc;
} }
static struct platform_driver hvc_opal_driver = { static struct platform_driver hvc_opal_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment