Hi Bjorn,

Please find the proposed patch attached.

Le 13/07/2021 à 10:27, Maxim Kuvyrkov a écrit :
Hi Bjorn,

You are the most active committer for qdl — so forwarding this question to you.

Regards,

--
Maxim Kuvyrkov
https://www.linaro.org

On 13 Jul 2021, at 11:16, Pascal Bourguignon <p...@sbde.fr> wrote:

Hello,

I've got a little patch for qdl, adding error messages.
https://git.linaro.org/landing-teams/working/qualcomm/qdl.git/
What would be the right place to send it to?


--
__Pascal Bourguignon__
http://www.sbde.fr/
From a2364afa4f6b38bd9836bfba3f24a80399b77613 Mon Sep 17 00:00:00 2001
From: Pascal Bourguignon <pascal.bourguig...@qorvo.com>
Date: Tue, 13 Jul 2021 10:06:39 +0200
Subject: [PATCH] Added error messages.

---
 qdl.c    | 15 +++++++++------
 sahara.c |  4 +++-
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/qdl.c b/qdl.c
index 256ca96..efc41a0 100644
--- a/qdl.c
+++ b/qdl.c
@@ -477,16 +477,19 @@ int main(int argc, char **argv)
        } while (++optind < argc);
 
        ret = usb_open(&qdl);
-       if (ret)
-               return 1;
+       if (ret){
+               errx(1, "usb_open error %d", ret);
+       }
 
        ret = sahara_run(&qdl, prog_mbn);
-       if (ret < 0)
-               return 1;
+       if (ret < 0){
+               errx(1, "sahara_run error %d", ret);
+       }
 
        ret = firehose_run(&qdl, incdir, storage);
-       if (ret < 0)
-               return 1;
+       if (ret < 0){
+               errx(1, "firehose_run error %d", ret);
+       }
 
        return 0;
 }
diff --git a/sahara.c b/sahara.c
index 27082a2..34284dc 100644
--- a/sahara.c
+++ b/sahara.c
@@ -204,8 +204,10 @@ int sahara_run(struct qdl_device *qdl, char *prog_mbn)
 
        while (!done) {
                n = qdl_read(qdl, buf, sizeof(buf), 1000);
-               if (n < 0)
+               if (n < 0){
+                       fprintf(stderr,"Cannot read qdl device\n");
                        break;
+               }
 
                pkt = (struct sahara_pkt*)buf;
                if (n != pkt->length) {
-- 
2.20.1

_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to