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:38 UTC

[mynewt-core] 08/14: hw/bus/i2c: Fix node debug poisoning

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 f08bf6639feb01e8da83852672faf702f241c008
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Nov 26 11:35:58 2018 +0100

    hw/bus/i2c: Fix node debug poisoning
---
 hw/bus/i2c/src/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/bus/i2c/src/i2c.c b/hw/bus/i2c/src/i2c.c
index d9170b7..cbbe948 100644
--- a/hw/bus/i2c/src/i2c.c
+++ b/hw/bus/i2c/src/i2c.c
@@ -159,6 +159,8 @@ bus_i2c_dev_init_func(struct os_dev *odev, void *arg)
     struct hal_i2c_hw_settings hal_cfg;
     int rc;
 
+    BUS_DEBUG_POISON_DEV(dev);
+
     hal_cfg.pin_scl = cfg->pin_scl;
     hal_cfg.pin_sda = cfg->pin_sda;
     rc = hal_i2c_init_hw(cfg->i2c_num, &hal_cfg);
@@ -166,8 +168,6 @@ bus_i2c_dev_init_func(struct os_dev *odev, void *arg)
         return SYS_EINVAL;
     }
 
-    BUS_DEBUG_POISON_DEV(dev);
-
     rc = bus_dev_init_func(odev, (void*)&bus_i2c_ops);
     assert(rc == 0);