hw/bus/i2c: Fix node debug poisoning
@@ -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);
