Commit 5cb9954a authored by Marek Belisko's avatar Marek Belisko Committed by Greg Kroah-Hartman

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: default avatarMarek Belisko <marek.belisko@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a252d02f
...@@ -685,7 +685,7 @@ void CardSendCommand(struct ft1000_device *ft1000dev, void *ptempbuffer, int siz ...@@ -685,7 +685,7 @@ void CardSendCommand(struct ft1000_device *ft1000dev, void *ptempbuffer, int siz
// //
// Returns: None // Returns: None
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void dsp_reload (struct ft1000_device *ft1000dev) int dsp_reload(struct ft1000_device *ft1000dev)
{ {
u16 status; u16 status;
USHORT tempword; USHORT tempword;
...@@ -696,7 +696,6 @@ void dsp_reload (struct ft1000_device *ft1000dev) ...@@ -696,7 +696,6 @@ void dsp_reload (struct ft1000_device *ft1000dev)
pft1000info = netdev_priv(ft1000dev->net); pft1000info = netdev_priv(ft1000dev->net);
pft1000info->CardReady = 0; pft1000info->CardReady = 0;
pft1000info->DSP_loading= 1;
// Program Interrupt Mask register // Program Interrupt Mask register
status = ft1000_write_register (ft1000dev, 0xffff, FT1000_REG_SUP_IMASK); status = ft1000_write_register (ft1000dev, 0xffff, FT1000_REG_SUP_IMASK);
...@@ -723,14 +722,13 @@ void dsp_reload (struct ft1000_device *ft1000dev) ...@@ -723,14 +722,13 @@ void dsp_reload (struct ft1000_device *ft1000dev)
// call codeloader // call codeloader
status = scram_dnldr(ft1000dev, pFileStart, FileLength); status = scram_dnldr(ft1000dev, pFileStart, FileLength);
if ( status != STATUS_SUCCESS) if (status != STATUS_SUCCESS)
return; return -EIO;
msleep(1000); msleep(1000);
pft1000info->DSP_loading= 0;
DEBUG("dsp_reload returned\n"); DEBUG("dsp_reload returned\n");
return 0;
} }
...@@ -1054,7 +1052,6 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev) ...@@ -1054,7 +1052,6 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
pInfo->CurrentInterruptEnableMask = ISR_DEFAULT_MASK; pInfo->CurrentInterruptEnableMask = ISR_DEFAULT_MASK;
pInfo->InterruptsEnabled = FALSE; pInfo->InterruptsEnabled = FALSE;
pInfo->CardReady = 0; pInfo->CardReady = 0;
pInfo->DSP_loading = 0;
pInfo->DSP_TIME[0] = 0; pInfo->DSP_TIME[0] = 0;
pInfo->DSP_TIME[1] = 0; pInfo->DSP_TIME[1] = 0;
pInfo->DSP_TIME[2] = 0; pInfo->DSP_TIME[2] = 0;
...@@ -2252,7 +2249,6 @@ static int ft1000_dsp_prov(void *arg) ...@@ -2252,7 +2249,6 @@ static int ft1000_dsp_prov(void *arg)
info->fProvComplete = 1; info->fProvComplete = 1;
info->CardReady = 1; info->CardReady = 1;
info->DSP_loading= 0;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
......
...@@ -182,18 +182,16 @@ static int ft1000_probe(struct usb_interface *interface, const struct usb_device ...@@ -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=%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 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 gPollingfailed = FALSE; //mbelian
pft1000info->pPollThread = kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll"); pft1000info->pPollThread = kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll");
msleep(500); //mbelian msleep(500); //mbelian
if ( pft1000info->DSP_loading )
{
DEBUG("ERROR!!!! RETURN FROM ft1000_probe **********************\n");
return 0;
}
while (!pft1000info->CardReady) while (!pft1000info->CardReady)
{ {
if ( gPollingfailed ) if ( gPollingfailed )
...@@ -220,6 +218,8 @@ static int ft1000_probe(struct usb_interface *interface, const struct usb_device ...@@ -220,6 +218,8 @@ static int ft1000_probe(struct usb_interface *interface, const struct usb_device
return 0; return 0;
err_load:
kfree(pFileStart);
err_fw: err_fw:
kfree(ft1000dev); kfree(ft1000dev);
return ret; return ret;
......
...@@ -554,7 +554,6 @@ typedef struct _FT1000_INFO { ...@@ -554,7 +554,6 @@ typedef struct _FT1000_INFO {
int IOCTLBufLvl; int IOCTLBufLvl;
int DeviceCreated; int DeviceCreated;
int CardReady; int CardReady;
int DSP_loading;
int NetDevRegDone; int NetDevRegDone;
u8 CardNumber; u8 CardNumber;
u8 DeviceName[15]; u8 DeviceName[15];
...@@ -632,7 +631,7 @@ void ft1000_free_buffer (PDPRAM_BLK pdpram_blk, struct list_head *plist); ...@@ -632,7 +631,7 @@ void ft1000_free_buffer (PDPRAM_BLK pdpram_blk, struct list_head *plist);
char *getfw (char *fn, size_t *pimgsz); 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); u16 init_ft1000_netdev(struct ft1000_device *ft1000dev);
struct usb_interface; struct usb_interface;
u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf); u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf);
......
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