staging: ft1000: Use specific error codes instead self defined.
authorMarek Belisko <marek.belisko@gmail.com>
Tue, 2 Nov 2010 13:51:44 +0000 (14:51 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 10 Nov 2010 00:07:03 +0000 (16:07 -0800)
Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c

index 90394e10ad2e30da0e1bc250f05113e520e8ed0e..9bb537734e8419be9414b95b3a623b6cb2eaa0a3 100644 (file)
@@ -1025,7 +1025,7 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
     {
 
         DEBUG("ft1000_copy_down_pkt::Card Not Ready\n");
-       return STATUS_FAILURE;
+       return -ENODEV;
 
     }
 
@@ -1037,7 +1037,7 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
     {
         DEBUG("Error:ft1000_copy_down_pkt:Message Size Overflow!\n");
        DEBUG("size = %d\n", count);
-       return STATUS_FAILURE;
+       return -EINVAL;
     }
 
     if ( count % 4)
@@ -1080,25 +1080,18 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
     }*/
 
 
-    ret = usb_submit_urb(pFt1000Dev->tx_urb, GFP_ATOMIC);
-    if(ret)
-    {
+       ret = usb_submit_urb(pFt1000Dev->tx_urb, GFP_ATOMIC);
+       if (ret) {
                DEBUG("ft1000 failed tx_urb %d\n", ret);
-
-               return STATUS_FAILURE;
-
-    }
-    else
-    {
-        //DEBUG("ft1000 sucess tx_urb %d\n", ret);
-
-        pInfo->stats.tx_packets++;
-        pInfo->stats.tx_bytes += (len+14);
-    }
+               return ret;
+       } else {
+               pInfo->stats.tx_packets++;
+               pInfo->stats.tx_bytes += (len+14);
+       }
 
     //DEBUG("ft1000_copy_down_pkt() exit\n");
 
-    return STATUS_SUCCESS;
+       return 0;
 }
 
 //---------------------------------------------------------------------------
This page took 0.026909 seconds and 5 git commands to generate.