From: Mark Hounschell Date: Tue, 11 Mar 2014 14:02:19 +0000 (-0400) Subject: staging: dgap: Remove unneeded code from dgap.c X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=928d70bb1ee5cde62978b6d6e59817a426b5454a;p=linux-beck.git staging: dgap: Remove unneeded code from dgap.c This patch removes more unneeded code that was supporting the old firmware loading process Signed-off-by: Mark Hounschell Tested-by: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 1995232f5606..8580ddc5bde6 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -4712,7 +4712,6 @@ static void dgap_poll_tasklet(unsigned long data) { struct board_t *bd = (struct board_t *) data; ulong lock_flags; - ulong lock_flags2; char *vaddr; u16 head, tail; @@ -4771,154 +4770,6 @@ out: return; } - /* Our state machine to get the board up and running */ - - /* Reset board */ - if (bd->state == NEED_RESET) { - - /* Get VPD info */ - dgap_get_vpd(bd); - - dgap_do_reset_board(bd); - } - - /* Move to next state */ - if (bd->state == FINISHED_RESET) - bd->state = NEED_CONFIG; - - if (bd->state == NEED_CONFIG) { - /* - * Match this board to a config the user created for us. - */ - bd->bd_config = dgap_find_config(bd->type, bd->pci_bus, - bd->pci_slot); - - /* - * Because the 4 port Xr products share the same PCI ID - * as the 8 port Xr products, if we receive a NULL config - * back, and this is a PAPORT8 board, retry with a - * PAPORT4 attempt as well. - */ - if (bd->type == PAPORT8 && !bd->bd_config) - bd->bd_config = dgap_find_config(PAPORT4, bd->pci_bus, - bd->pci_slot); - - /* - * Register the ttys (if any) into the kernel. - */ - if (bd->bd_config) - bd->state = FINISHED_CONFIG; - else - bd->state = CONFIG_NOT_FOUND; - } - - /* Move to next state */ - if (bd->state == FINISHED_CONFIG) - bd->state = NEED_DEVICE_CREATION; - - /* Move to next state */ - if (bd->state == NEED_DEVICE_CREATION) { - /* - * Signal downloader, its got some work to do. - */ - DGAP_LOCK(dgap_dl_lock, lock_flags2); - if (dgap_dl_action != 1) { - dgap_dl_action = 1; - wake_up_interruptible(&dgap_dl_wait); - } - DGAP_UNLOCK(dgap_dl_lock, lock_flags2); - } - - /* Move to next state */ - if (bd->state == FINISHED_DEVICE_CREATION) - bd->state = NEED_BIOS_LOAD; - - /* Move to next state */ - if (bd->state == NEED_BIOS_LOAD) { - /* - * Signal downloader, its got some work to do. - */ - DGAP_LOCK(dgap_dl_lock, lock_flags2); - if (dgap_dl_action != 1) { - dgap_dl_action = 1; - wake_up_interruptible(&dgap_dl_wait); - } - DGAP_UNLOCK(dgap_dl_lock, lock_flags2); - } - - /* Wait for BIOS to test board... */ - if (bd->state == WAIT_BIOS_LOAD) - dgap_do_wait_for_bios(bd); - - /* Move to next state */ - if (bd->state == FINISHED_BIOS_LOAD) { - bd->state = NEED_FEP_LOAD; - - /* - * Signal downloader, its got some work to do. - */ - DGAP_LOCK(dgap_dl_lock, lock_flags2); - if (dgap_dl_action != 1) { - dgap_dl_action = 1; - wake_up_interruptible(&dgap_dl_wait); - } - DGAP_UNLOCK(dgap_dl_lock, lock_flags2); - } - - /* Wait for FEP to load on board... */ - if (bd->state == WAIT_FEP_LOAD) - dgap_do_wait_for_fep(bd); - - /* Move to next state */ - if (bd->state == FINISHED_FEP_LOAD) { - - /* - * Do tty device initialization. - */ - int rc = dgap_tty_init(bd); - - if (rc < 0) { - dgap_tty_uninit(bd); - bd->state = BOARD_FAILED; - bd->dpastatus = BD_NOFEP; - } else { - bd->state = NEED_PROC_CREATION; - - /* - * Signal downloader, its got some work to do. - */ - DGAP_LOCK(dgap_dl_lock, lock_flags2); - if (dgap_dl_action != 1) { - dgap_dl_action = 1; - wake_up_interruptible(&dgap_dl_wait); - } - DGAP_UNLOCK(dgap_dl_lock, lock_flags2); - } - } - - /* Move to next state */ - if (bd->state == FINISHED_PROC_CREATION) { - - bd->state = BOARD_READY; - bd->dpastatus = BD_RUNNING; - - /* - * If user requested the board to run in interrupt mode, - * go and set it up on the board. - */ - if (bd->intr_used) { - writew(1, (bd->re_map_membase + ENABLE_INTR)); - /* - * Tell the board to poll the UARTS as fast as possible. - */ - writew(FEPPOLL_MIN, (bd->re_map_membase + FEPPOLL)); - bd->intr_running = 1; - } - - /* Wake up anyone waiting for board state to change to ready */ - wake_up_interruptible(&bd->state_wait); - } - DGAP_UNLOCK(bd->bd_lock, lock_flags); }