From 972cc03f9a11b524eec041771bb73cd4caf1e14f Mon Sep 17 00:00:00 2001 From: Yaochenger <1516081466@qq.com> Date: Tue, 3 Sep 2024 13:28:06 +0800 Subject: [PATCH] =?UTF-8?q?[fix][device]=20=E4=BF=AE=E6=AD=A3=E4=BD=BF?= =?UTF-8?q?=E7=94=A8rt=5Fdevice=5Fcreate=E5=88=9B=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=EF=BC=8C=E4=BD=BF=E7=94=A8rt=5Fdevice=5Fdestroy?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/core/device.c | 2 +- src/object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/drivers/core/device.c b/components/drivers/core/device.c index c99cddf62ba..49b428a5771 100644 --- a/components/drivers/core/device.c +++ b/components/drivers/core/device.c @@ -163,7 +163,7 @@ void rt_device_destroy(rt_device_t dev) { /* parameter check */ RT_ASSERT(dev != RT_NULL); - RT_ASSERT(rt_object_get_type(&dev->parent) == RT_Object_Class_Device); + RT_ASSERT(rt_object_get_type(&dev->parent) == RT_Object_Class_Null); RT_ASSERT(rt_object_is_systemobject(&dev->parent) == RT_FALSE); rt_object_detach(&(dev->parent)); diff --git a/src/object.c b/src/object.c index 0cb1a188a30..4e28eeb57e1 100644 --- a/src/object.c +++ b/src/object.c @@ -429,7 +429,7 @@ void rt_object_detach(rt_object_t object) rt_list_remove(&(object->list)); rt_spin_unlock_irqrestore(&(information->spinlock), level); - object->type = 0; + object->type = RT_Object_Class_Null; } #ifdef RT_USING_HEAP