Commit 92ded48c authored by Konrad Zapalowicz's avatar Konrad Zapalowicz Committed by Greg Kroah-Hartman

staging: dgnc: Siplify the dgnc_start function

This commit slightly simplifies the sgnc_start() function by
rearranging it. As a result the indentation level is reduced.
This is not the functional change.
Signed-off-by: default avatarKonrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9a633d00
...@@ -278,15 +278,13 @@ static int dgnc_start(void) ...@@ -278,15 +278,13 @@ static int dgnc_start(void)
int rc = 0; int rc = 0;
unsigned long flags; unsigned long flags;
if (dgnc_driver_start == FALSE) { if (dgnc_driver_start == TRUE)
return rc;
dgnc_driver_start = TRUE; dgnc_driver_start = TRUE;
/* make sure that the globals are init'd before we do anything else */ /* make sure that the globals are init'd before we do anything else */
dgnc_init_globals(); dgnc_init_globals();
dgnc_NumBoards = 0;
APR(("For the tools package or updated drivers please visit http://www.digi.com\n")); APR(("For the tools package or updated drivers please visit http://www.digi.com\n"));
/* /*
...@@ -301,8 +299,7 @@ static int dgnc_start(void) ...@@ -301,8 +299,7 @@ static int dgnc_start(void)
rc = register_chrdev(0, "dgnc", &dgnc_BoardFops); rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
if (rc <= 0) { if (rc <= 0) {
APR(("Can't register dgnc driver device (%d)\n", rc)); APR(("Can't register dgnc driver device (%d)\n", rc));
rc = -ENXIO; return -ENXIO;
return rc;
} }
dgnc_Major = rc; dgnc_Major = rc;
...@@ -335,7 +332,6 @@ static int dgnc_start(void) ...@@ -335,7 +332,6 @@ static int dgnc_start(void)
add_timer(&dgnc_poll_timer); add_timer(&dgnc_poll_timer);
dgnc_driver_state = DRIVER_READY; dgnc_driver_state = DRIVER_READY;
}
return rc; return rc;
} }
...@@ -814,6 +810,7 @@ static void dgnc_init_globals(void) ...@@ -814,6 +810,7 @@ static void dgnc_init_globals(void)
dgnc_rawreadok = rawreadok; dgnc_rawreadok = rawreadok;
dgnc_trcbuf_size = trcbuf_size; dgnc_trcbuf_size = trcbuf_size;
dgnc_debug = debug; dgnc_debug = debug;
dgnc_NumBoards = 0;
for (i = 0; i < MAXBOARDS; i++) for (i = 0; i < MAXBOARDS; i++)
dgnc_Board[i] = NULL; dgnc_Board[i] = NULL;
......
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