Commit 1cd7c062 authored by Daeseok Youn's avatar Daeseok Youn Committed by Greg Kroah-Hartman

staging: dgnc: remove useless variables

The dgnc_major_serial_registered and dgnc_major_serial_registered
do not need to use to check whether the tty driver is registered or not.
These variables are used only in dgnc_cleanup_tty() function,
This function will be called normally with initialized board structure.
It means the dgnc_cleanup_tty() cannot be called with unregistered tty.
Signed-off-by: default avatarDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 33ccb442
...@@ -203,9 +203,6 @@ struct dgnc_board { ...@@ -203,9 +203,6 @@ struct dgnc_board {
struct tty_driver *print_driver; struct tty_driver *print_driver;
char print_name[200]; char print_name[200];
bool dgnc_major_serial_registered;
bool dgnc_major_transparent_print_registered;
u16 dpatype; /* The board "type", u16 dpatype; /* The board "type",
* as defined by DPA * as defined by DPA
*/ */
......
...@@ -204,16 +204,12 @@ int dgnc_tty_register(struct dgnc_board *brd) ...@@ -204,16 +204,12 @@ int dgnc_tty_register(struct dgnc_board *brd)
*/ */
tty_set_operations(brd->serial_driver, &dgnc_tty_ops); tty_set_operations(brd->serial_driver, &dgnc_tty_ops);
if (!brd->dgnc_major_serial_registered) {
/* Register tty devices */
rc = tty_register_driver(brd->serial_driver); rc = tty_register_driver(brd->serial_driver);
if (rc < 0) { if (rc < 0) {
dev_dbg(&brd->pdev->dev, dev_dbg(&brd->pdev->dev,
"Can't register tty device (%d)\n", rc); "Can't register tty device (%d)\n", rc);
goto free_serial_driver; goto free_serial_driver;
} }
brd->dgnc_major_serial_registered = true;
}
/* /*
* If we're doing transparent print, we have to do all of the above * If we're doing transparent print, we have to do all of the above
...@@ -247,8 +243,6 @@ int dgnc_tty_register(struct dgnc_board *brd) ...@@ -247,8 +243,6 @@ int dgnc_tty_register(struct dgnc_board *brd)
*/ */
tty_set_operations(brd->print_driver, &dgnc_tty_ops); tty_set_operations(brd->print_driver, &dgnc_tty_ops);
if (!brd->dgnc_major_transparent_print_registered) {
/* Register Transparent Print devices */
rc = tty_register_driver(brd->print_driver); rc = tty_register_driver(brd->print_driver);
if (rc < 0) { if (rc < 0) {
dev_dbg(&brd->pdev->dev, dev_dbg(&brd->pdev->dev,
...@@ -256,8 +250,6 @@ int dgnc_tty_register(struct dgnc_board *brd) ...@@ -256,8 +250,6 @@ int dgnc_tty_register(struct dgnc_board *brd)
rc); rc);
goto free_print_driver; goto free_print_driver;
} }
brd->dgnc_major_transparent_print_registered = true;
}
dgnc_BoardsByMajor[brd->serial_driver->major] = brd; dgnc_BoardsByMajor[brd->serial_driver->major] = brd;
...@@ -396,7 +388,6 @@ void dgnc_cleanup_tty(struct dgnc_board *brd) ...@@ -396,7 +388,6 @@ void dgnc_cleanup_tty(struct dgnc_board *brd)
{ {
int i = 0; int i = 0;
if (brd->dgnc_major_serial_registered) {
dgnc_BoardsByMajor[brd->serial_driver->major] = NULL; dgnc_BoardsByMajor[brd->serial_driver->major] = NULL;
for (i = 0; i < brd->nasync; i++) { for (i = 0; i < brd->nasync; i++) {
if (brd->channels[i]) if (brd->channels[i])
...@@ -405,10 +396,7 @@ void dgnc_cleanup_tty(struct dgnc_board *brd) ...@@ -405,10 +396,7 @@ void dgnc_cleanup_tty(struct dgnc_board *brd)
tty_unregister_device(brd->serial_driver, i); tty_unregister_device(brd->serial_driver, i);
} }
tty_unregister_driver(brd->serial_driver); tty_unregister_driver(brd->serial_driver);
brd->dgnc_major_serial_registered = false;
}
if (brd->dgnc_major_transparent_print_registered) {
dgnc_BoardsByMajor[brd->print_driver->major] = NULL; dgnc_BoardsByMajor[brd->print_driver->major] = NULL;
for (i = 0; i < brd->nasync; i++) { for (i = 0; i < brd->nasync; i++) {
if (brd->channels[i]) if (brd->channels[i])
...@@ -417,8 +405,6 @@ void dgnc_cleanup_tty(struct dgnc_board *brd) ...@@ -417,8 +405,6 @@ void dgnc_cleanup_tty(struct dgnc_board *brd)
tty_unregister_device(brd->print_driver, i); tty_unregister_device(brd->print_driver, i);
} }
tty_unregister_driver(brd->print_driver); tty_unregister_driver(brd->print_driver);
brd->dgnc_major_transparent_print_registered = false;
}
put_tty_driver(brd->serial_driver); put_tty_driver(brd->serial_driver);
put_tty_driver(brd->print_driver); put_tty_driver(brd->print_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