You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2018/11/29 21:08:43 UTC

[mynewt-core] 13/14: hw/bus/i2c: Make sure node config is set before init

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit e2261fb26b2aa83e605f1e953a9683ee46d06ef2
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Nov 26 11:40:14 2018 +0100

    hw/bus/i2c: Make sure node config is set before init
---
 hw/bus/i2c/src/i2c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/bus/i2c/src/i2c.c b/hw/bus/i2c/src/i2c.c
index afca233..df12c49 100644
--- a/hw/bus/i2c/src/i2c.c
+++ b/hw/bus/i2c/src/i2c.c
@@ -209,14 +209,14 @@ bus_i2c_node_init_func(struct os_dev *odev, void *arg)
 
     BUS_DEBUG_POISON_NODE(node);
 
+    node->freq = cfg->freq;
+    node->addr = cfg->addr;
+    node->quirks = cfg->quirks;
+
     rc = bus_node_init_func(odev, node_cfg);
     if (rc) {
         return rc;
     }
 
-    node->freq = cfg->freq;
-    node->addr = cfg->addr;
-    node->quirks = cfg->quirks;
-
     return 0;
 }