Skip to content

Commit bd3e43e

Browse files
Mark Hounschellgregkh
authored andcommitted
staging: dgap: remove more unneeded brd-state states
This patch removes more unneeded brd-state states Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b2e78c2 commit bd3e43e

2 files changed

Lines changed: 17 additions & 20 deletions

File tree

‎drivers/staging/dgap/dgap.c‎

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ static int dgap_finalize_board_init(struct board_t *brd);
221221

222222
static void dgap_get_vpd(struct board_t *brd);
223223
static void dgap_do_reset_board(struct board_t *brd);
224-
static void dgap_do_wait_for_bios(struct board_t *brd);
225-
static void dgap_do_wait_for_fep(struct board_t *brd);
224+
static int dgap_do_wait_for_bios(struct board_t *brd);
225+
static int dgap_do_wait_for_fep(struct board_t *brd);
226226
static int dgap_tty_register_ports(struct board_t *brd);
227227
static int dgap_firmware_load(struct pci_dev *pdev, int card_type);
228228

@@ -923,9 +923,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
923923
release_firmware(fw);
924924

925925
/* Wait for BIOS to test board... */
926-
dgap_do_wait_for_bios(brd);
927-
928-
if (brd->state != FINISHED_BIOS_LOAD)
926+
if (!dgap_do_wait_for_bios(brd))
929927
return -ENXIO;
930928
}
931929

@@ -941,9 +939,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
941939
release_firmware(fw);
942940

943941
/* Wait for FEP to load on board... */
944-
dgap_do_wait_for_fep(brd);
945-
946-
if (brd->state != FINISHED_FEP_LOAD)
942+
if (!dgap_do_wait_for_fep(brd))
947943
return -ENXIO;
948944
}
949945

@@ -4368,15 +4364,16 @@ static void dgap_do_bios_load(struct board_t *brd, uchar __user *ubios, int len)
43684364
/*
43694365
* Checks to see if the BIOS completed running on the card.
43704366
*/
4371-
static void dgap_do_wait_for_bios(struct board_t *brd)
4367+
static int dgap_do_wait_for_bios(struct board_t *brd)
43724368
{
43734369
uchar *addr;
43744370
u16 word;
43754371
u16 err1;
43764372
u16 err2;
4373+
int ret = 0;
43774374

43784375
if (!brd || (brd->magic != DGAP_BOARD_MAGIC) || !brd->re_map_membase)
4379-
return;
4376+
return ret;
43804377

43814378
addr = brd->re_map_membase;
43824379
word = readw(addr + POSTAREA);
@@ -4389,10 +4386,8 @@ static void dgap_do_wait_for_bios(struct board_t *brd)
43894386
brd->wait_for_bios = 0;
43904387
while (brd->wait_for_bios < 1000) {
43914388
/* Check to see if BIOS thinks board is good. (GD). */
4392-
if (word == *(u16 *) "GD") {
4393-
brd->state = FINISHED_BIOS_LOAD;
4394-
return;
4395-
}
4389+
if (word == *(u16 *) "GD")
4390+
return 1;
43964391
msleep_interruptible(10);
43974392
brd->wait_for_bios++;
43984393
word = readw(addr + POSTAREA);
@@ -4405,6 +4400,8 @@ static void dgap_do_wait_for_bios(struct board_t *brd)
44054400
brd->name, err1, err2);
44064401
brd->state = BOARD_FAILED;
44074402
brd->dpastatus = BD_NOBIOS;
4403+
4404+
return ret;
44084405
}
44094406

44104407
/*
@@ -4455,15 +4452,16 @@ static void dgap_do_fep_load(struct board_t *brd, uchar __user *ufep, int len)
44554452
/*
44564453
* Waits for the FEP to report thats its ready for us to use.
44574454
*/
4458-
static void dgap_do_wait_for_fep(struct board_t *brd)
4455+
static int dgap_do_wait_for_fep(struct board_t *brd)
44594456
{
44604457
uchar *addr;
44614458
u16 word;
44624459
u16 err1;
44634460
u16 err2;
4461+
int ret = 0;
44644462

44654463
if (!brd || (brd->magic != DGAP_BOARD_MAGIC) || !brd->re_map_membase)
4466-
return;
4464+
return ret;
44674465

44684466
addr = brd->re_map_membase;
44694467
word = readw(addr + FEPSTAT);
@@ -4476,15 +4474,14 @@ static void dgap_do_wait_for_fep(struct board_t *brd)
44764474
while (brd->wait_for_fep < 500) {
44774475
/* Check to see if FEP is up and running now. */
44784476
if (word == *(u16 *) "OS") {
4479-
brd->state = FINISHED_FEP_LOAD;
44804477
/*
44814478
* Check to see if the board can support FEP5+ commands.
44824479
*/
44834480
word = readw(addr + FEP5_PLUS);
44844481
if (word == *(u16 *) "5A")
44854482
brd->bd_flags |= BD_FEP5PLUS;
44864483

4487-
return;
4484+
return 1;
44884485
}
44894486
msleep_interruptible(10);
44904487
brd->wait_for_fep++;
@@ -4498,6 +4495,8 @@ static void dgap_do_wait_for_fep(struct board_t *brd)
44984495
brd->name, err1, err2);
44994496
brd->state = BOARD_FAILED;
45004497
brd->dpastatus = BD_NOFEP;
4498+
4499+
return ret;
45014500
}
45024501

45034502
/*

‎drivers/staging/dgap/dgap.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,6 @@ enum {
487487
*/
488488
enum {
489489
BOARD_FAILED = 0,
490-
FINISHED_BIOS_LOAD,
491-
FINISHED_FEP_LOAD,
492490
BOARD_READY
493491
};
494492

0 commit comments

Comments
 (0)