summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 2cecdb0663f4..392d5328c7d9 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -224,6 +224,11 @@ int dgnc_tty_register(struct dgnc_board *brd)
TTY_DRIVER_DYNAMIC_DEV |
TTY_DRIVER_HARDWARE_BREAK);
+ if (IS_ERR(brd->print_driver)) {
+ rc = PTR_ERR(brd->print_driver);
+ goto unregister_serial_driver;
+ }
+
snprintf(brd->print_name, MAXTTYNAMELEN, "pr_dgnc_%d_", brd->boardnum);
brd->print_driver->name = brd->print_name;
@@ -235,11 +240,6 @@ int dgnc_tty_register(struct dgnc_board *brd)
brd->print_driver->init_termios = DgncDefaultTermios;
brd->print_driver->driver_name = DRVSTR;
- if (IS_ERR(brd->print_driver)) {
- rc = PTR_ERR(brd->print_driver);
- goto unregister_serial_driver;
- }
-
/*
* Entry points for driver. Called by the kernel from
* tty_io.c and n_tty.c.