diff --git a/sys/dev/drm2/radeon/radeon_i2c.c b/sys/dev/drm2/radeon/radeon_i2c.c index fa47638..d923aaa 100644 --- a/sys/dev/drm2/radeon/radeon_i2c.c +++ b/sys/dev/drm2/radeon/radeon_i2c.c @@ -1205,6 +1205,10 @@ void radeon_i2c_destroy(struct radeon_i2c_chan *i2c) int ret; mtx_lock(&Giant); + if (i2c->adapter != NULL && + device_get_parent(i2c->adapter) == i2c->iic_bus) { + device_delete_child(i2c->iic_bus, i2c->adapter); + } ret = device_delete_child(i2c->dev->device, i2c->iic_bus); mtx_unlock(&Giant); KASSERT(ret == 0, ("unable to detach iic bus %s: %d",