suppress error callbacks if requested
authorFelix Fietkau <nbd@openwrt.org>
Sun, 17 Feb 2013 17:52:19 +0000 (18:52 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 17 Feb 2013 17:52:19 +0000 (18:52 +0100)
dev.c
uqmi.h

diff --git a/dev.c b/dev.c
index 486230a..ed9d60f 100644 (file)
--- a/dev.c
+++ b/dev.c
@@ -58,7 +58,7 @@ static void __qmi_request_complete(struct qmi_dev *qmi, struct qmi_request *req,
        if (req->ret)
                msg = NULL;
 
-       if (req->cb)
+       if (req->cb && (msg || !req->no_error_cb))
                req->cb(qmi, req, msg);
 
        if (req->complete) {
diff --git a/uqmi.h b/uqmi.h
index a404da5..2f06890 100644 (file)
--- a/uqmi.h
+++ b/uqmi.h
@@ -70,6 +70,7 @@ struct qmi_request {
 
        bool *complete;
        bool pending;
+       bool no_error_cb;
        uint8_t service;
        uint16_t tid;
        int ret;