[PATCH 15/25] efw-downloader: subcmd-device: bind Fireworks protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This commit binds Fireworks protocol for the given node.

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
 efw-downloader/src/subcmd-device.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/efw-downloader/src/subcmd-device.c b/efw-downloader/src/subcmd-device.c
index b93d62d..1bfa1f2 100644
--- a/efw-downloader/src/subcmd-device.c
+++ b/efw-downloader/src/subcmd-device.c
@@ -100,7 +100,26 @@ int subcmd_device(int argc, char **argv)
         goto err_node;
     }
 
+    proto = efw_proto_new();
+    efw_proto_bind(proto, node, &error);
+    if (error != NULL) {
+        if (g_error_matches(error, HINAWA_FW_NODE_ERROR, HINAWA_FW_NODE_ERROR_FAILED)) {
+            if (strstr(error->message, "16") != NULL) {
+                fprintf(stderr, "The range of address on 1394 OHCI controller already used by "
+                        "ALSA fireworks driver.\n");
+            } else {
+                report_error(error, "bind protocol");
+            }
+        } else {
+            report_error(error, "bind protocol");
+        }
+        goto err_node;
+    }
+
     entry->op(argc, argv, proto, &error);
+
+    efw_proto_unbind(proto);
+    g_object_unref(proto);
 err_node:
     g_object_unref(node);
 err:
-- 
2.25.1




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux