Skip to content

Commit

Permalink
staging: ft1000-usb: Remove global flag DSP_loading.
Browse files Browse the repository at this point in the history
This patch remove global flag DSP_loading which was checked
only on one place. Instead check return value for dsp_reload() function.

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Oct 12, 2010
1 parent a252d02 commit 5cb9954
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
12 changes: 4 additions & 8 deletions drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ void CardSendCommand(struct ft1000_device *ft1000dev, void *ptempbuffer, int siz
//
// Returns: None
//-----------------------------------------------------------------------
void dsp_reload (struct ft1000_device *ft1000dev)
int dsp_reload(struct ft1000_device *ft1000dev)
{
u16 status;
USHORT tempword;
Expand All @@ -696,7 +696,6 @@ void dsp_reload (struct ft1000_device *ft1000dev)
pft1000info = netdev_priv(ft1000dev->net);

pft1000info->CardReady = 0;
pft1000info->DSP_loading= 1;

// Program Interrupt Mask register
status = ft1000_write_register (ft1000dev, 0xffff, FT1000_REG_SUP_IMASK);
Expand All @@ -723,14 +722,13 @@ void dsp_reload (struct ft1000_device *ft1000dev)
// call codeloader
status = scram_dnldr(ft1000dev, pFileStart, FileLength);

if ( status != STATUS_SUCCESS)
return;
if (status != STATUS_SUCCESS)
return -EIO;

msleep(1000);
pft1000info->DSP_loading= 0;

DEBUG("dsp_reload returned\n");

return 0;

}

Expand Down Expand Up @@ -1054,7 +1052,6 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
pInfo->CurrentInterruptEnableMask = ISR_DEFAULT_MASK;
pInfo->InterruptsEnabled = FALSE;
pInfo->CardReady = 0;
pInfo->DSP_loading = 0;
pInfo->DSP_TIME[0] = 0;
pInfo->DSP_TIME[1] = 0;
pInfo->DSP_TIME[2] = 0;
Expand Down Expand Up @@ -2252,7 +2249,6 @@ static int ft1000_dsp_prov(void *arg)

info->fProvComplete = 1;
info->CardReady = 1;
info->DSP_loading= 0;
return STATUS_SUCCESS;

}
Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,16 @@ static int ft1000_probe(struct usb_interface *interface, const struct usb_device
// DEBUG("In probe: pft1000info=%x\n", pft1000info); // aelias [-] reason: warning: format ???%x??? expects type ???unsigned int???, but argument 2 has type ???struct FT1000_INFO *???
DEBUG("In probe: pft1000info=%p\n", pft1000info); // aelias [+] reason: up

dsp_reload(ft1000dev);
ret = dsp_reload(ft1000dev);
if (ret) {
printk(KERN_ERR "Problem with DSP image loading\n");
goto err_load;
}

gPollingfailed = FALSE; //mbelian
pft1000info->pPollThread = kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll");
msleep(500); //mbelian


if ( pft1000info->DSP_loading )
{
DEBUG("ERROR!!!! RETURN FROM ft1000_probe **********************\n");
return 0;
}

while (!pft1000info->CardReady)
{
if ( gPollingfailed )
Expand All @@ -220,6 +218,8 @@ static int ft1000_probe(struct usb_interface *interface, const struct usb_device

return 0;

err_load:
kfree(pFileStart);
err_fw:
kfree(ft1000dev);
return ret;
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/ft1000/ft1000-usb/ft1000_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ typedef struct _FT1000_INFO {
int IOCTLBufLvl;
int DeviceCreated;
int CardReady;
int DSP_loading;
int NetDevRegDone;
u8 CardNumber;
u8 DeviceName[15];
Expand Down Expand Up @@ -632,7 +631,7 @@ void ft1000_free_buffer (PDPRAM_BLK pdpram_blk, struct list_head *plist);

char *getfw (char *fn, size_t *pimgsz);

void dsp_reload(struct ft1000_device *ft1000dev);
int dsp_reload(struct ft1000_device *ft1000dev);
u16 init_ft1000_netdev(struct ft1000_device *ft1000dev);
struct usb_interface;
u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf);
Expand Down

0 comments on commit 5cb9954

Please sign in to comment.