staging: ft1000-usb: Remove global flag DSP_loading.
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>
This commit is contained in:
parent
a252d02f89
commit
5cb9954a51
3 changed files with 13 additions and 18 deletions
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -2252,7 +2249,6 @@ static int ft1000_dsp_prov(void *arg)
|
|||
|
||||
info->fProvComplete = 1;
|
||||
info->CardReady = 1;
|
||||
info->DSP_loading= 0;
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
|
@ -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;
|
||||
|
|
|
@ -554,7 +554,6 @@ typedef struct _FT1000_INFO {
|
|||
int IOCTLBufLvl;
|
||||
int DeviceCreated;
|
||||
int CardReady;
|
||||
int DSP_loading;
|
||||
int NetDevRegDone;
|
||||
u8 CardNumber;
|
||||
u8 DeviceName[15];
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue