usbd: use status definitions
authorMinkyu Kang <mk7.kang@samsung.com>
Tue, 5 Jan 2010 00:36:10 +0000 (09:36 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 5 Jan 2010 00:36:10 +0000 (09:36 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
common/cmd_usbd.c
include/usbd.h

index 507f718..b2439af 100644 (file)
@@ -530,9 +530,9 @@ static int process_data(struct usbd_ops *usbd)
                                        (int)recvlen, (int)len);
 
                        /* Retry this commad */
-                       *((ulong *) usbd->tx_data) = 1;
+                       *((ulong *) usbd->tx_data) = STATUS_RETRY;
                } else
-                       *((ulong *) usbd->tx_data) = 0;
+                       *((ulong *) usbd->tx_data) = STATUS_DONE;
 
                usbd->send_data(usbd->tx_data, usbd->tx_len);
                return 1;
@@ -692,7 +692,7 @@ static int process_data(struct usbd_ops *usbd)
 
                usbd_phone_down();
 
-               *((ulong *) usbd->tx_data) = 0;
+               *((ulong *) usbd->tx_data) = STATUS_DONE;
                usbd->send_data(usbd->tx_data, usbd->tx_len);
                return 1;
 
@@ -798,11 +798,11 @@ static int process_data(struct usbd_ops *usbd)
 
        if (ret) {
                /* Retry this commad */
-               *((ulong *) usbd->tx_data) = 1;
+               *((ulong *) usbd->tx_data) = STATUS_RETRY;
                usbd->send_data(usbd->tx_data, usbd->tx_len);
                return 1;
        } else
-               *((ulong *) usbd->tx_data) = 0;
+               *((ulong *) usbd->tx_data) = STATUS_DONE;
 
        /* Write image success -> Report status */
        usbd->send_data(usbd->tx_data, usbd->tx_len);
index d7ab712..0ea1be9 100644 (file)
@@ -54,6 +54,13 @@ enum {
 #endif
 #define COMMAND_PROGRESS       230
 
+/* status definition */
+enum {
+       STATUS_DONE = 0,
+       STATUS_RETRY,
+       STATUS_ERROR,
+};
+
 /*
  * USB Downloader Operations
  * All functions and valuable are mandatory