forked from Minki/linux
staging: ft1000: Use specific error return value.
Signed-off-by: Marek Belisko <marek.belisko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
f9d173736b
commit
310bad04ec
@ -123,12 +123,12 @@ static int ft1000_control(struct ft1000_device *ft1000dev,unsigned int pipe,
|
|||||||
if (ft1000dev == NULL )
|
if (ft1000dev == NULL )
|
||||||
{
|
{
|
||||||
DEBUG("NULL ft1000dev, failure\n");
|
DEBUG("NULL ft1000dev, failure\n");
|
||||||
return STATUS_FAILURE;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
else if ( ft1000dev->dev == NULL )
|
else if ( ft1000dev->dev == NULL )
|
||||||
{
|
{
|
||||||
DEBUG("NULL ft1000dev->dev, failure\n");
|
DEBUG("NULL ft1000dev->dev, failure\n");
|
||||||
return STATUS_FAILURE;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = usb_control_msg(ft1000dev->dev,
|
ret = usb_control_msg(ft1000dev->dev,
|
||||||
@ -141,11 +141,8 @@ static int ft1000_control(struct ft1000_device *ft1000dev,unsigned int pipe,
|
|||||||
size,
|
size,
|
||||||
LARGE_TIMEOUT);
|
LARGE_TIMEOUT);
|
||||||
|
|
||||||
if (ret>0)
|
if (ret > 0)
|
||||||
ret = STATUS_SUCCESS;
|
ret = 0;
|
||||||
else
|
|
||||||
ret = STATUS_FAILURE;
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -186,8 +183,6 @@ u16 ft1000_read_register(struct ft1000_device *ft1000dev, u16* Data, u16 nRegInd
|
|||||||
//DEBUG("ft1000_read_register: ret is %d \n", ret);
|
//DEBUG("ft1000_read_register: ret is %d \n", ret);
|
||||||
|
|
||||||
//DEBUG("ft1000_read_register: data is %x \n", *Data);
|
//DEBUG("ft1000_read_register: data is %x \n", *Data);
|
||||||
if ( ret != STATUS_SUCCESS )
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -224,9 +219,6 @@ u16 ft1000_write_register(struct ft1000_device *ft1000dev, USHORT value, u16 nRe
|
|||||||
0,
|
0,
|
||||||
LARGE_TIMEOUT );
|
LARGE_TIMEOUT );
|
||||||
|
|
||||||
if ( ret != STATUS_SUCCESS )
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,8 +257,6 @@ u16 ft1000_read_dpram32(struct ft1000_device *ft1000dev, USHORT indx, PUCHAR buf
|
|||||||
//DEBUG("ft1000_read_dpram32: ret is %d \n", ret);
|
//DEBUG("ft1000_read_dpram32: ret is %d \n", ret);
|
||||||
|
|
||||||
//DEBUG("ft1000_read_dpram32: ret=%d \n", ret);
|
//DEBUG("ft1000_read_dpram32: ret=%d \n", ret);
|
||||||
if ( ret != STATUS_SUCCESS )
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -306,11 +296,6 @@ u16 ft1000_write_dpram32(struct ft1000_device *ft1000dev, USHORT indx, PUCHAR bu
|
|||||||
cnt, //buffer size
|
cnt, //buffer size
|
||||||
LARGE_TIMEOUT );
|
LARGE_TIMEOUT );
|
||||||
|
|
||||||
|
|
||||||
if ( ret != STATUS_SUCCESS )
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,8 +342,6 @@ u16 ft1000_read_dpram16(struct ft1000_device *ft1000dev, USHORT indx, PUCHAR buf
|
|||||||
|
|
||||||
|
|
||||||
//DEBUG("ft1000_read_dpram16: data is %x \n", *buffer);
|
//DEBUG("ft1000_read_dpram16: data is %x \n", *buffer);
|
||||||
if ( ret != STATUS_SUCCESS )
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -406,11 +389,6 @@ u16 ft1000_write_dpram16(struct ft1000_device *ft1000dev, USHORT indx, USHORT va
|
|||||||
0, //buffer size
|
0, //buffer size
|
||||||
LARGE_TIMEOUT );
|
LARGE_TIMEOUT );
|
||||||
|
|
||||||
|
|
||||||
if ( ret != STATUS_SUCCESS )
|
|
||||||
return STATUS_FAILURE;
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user