summaryrefslogtreecommitdiff
path: root/components/drivers/core
diff options
context:
space:
mode:
authorGuEe-GUI <[email protected]>2024-10-24 11:52:36 +0800
committerRbb666 <[email protected]>2024-11-18 15:03:23 +0800
commitb6f67285e942737fdddae7dae5acaa2045c1bead (patch)
tree6db6a65b04dc70851c3b61d28d905e4b5abd8882 /components/drivers/core
parent3b22dbd04960a1934994059a4ef97d8403be2a54 (diff)
[DM/FIXUP] remove OFW switch macros
The drivers will support OFW and name probe both. We should make build OK when OFW is disable. Signed-off-by: GuEe-GUI <[email protected]>
Diffstat (limited to 'components/drivers/core')
-rw-r--r--components/drivers/core/platform.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/components/drivers/core/platform.c b/components/drivers/core/platform.c
index d8c6679a6d..c3a141654a 100644
--- a/components/drivers/core/platform.c
+++ b/components/drivers/core/platform.c
@@ -78,21 +78,21 @@ static rt_bool_t platform_match(rt_driver_t drv, rt_device_t dev)
{
struct rt_platform_driver *pdrv = rt_container_of(drv, struct rt_platform_driver, parent);
struct rt_platform_device *pdev = rt_container_of(dev, struct rt_platform_device, parent);
-
-#ifdef RT_USING_OFW
struct rt_ofw_node *np = dev->ofw_node;
/* 1、match with ofw node */
if (np)
{
+ #ifdef RT_USING_OFW
pdev->id = rt_ofw_node_match(np, pdrv->ids);
-
+ #else
+ pdev->id = RT_NULL;
+ #endif
if (pdev->id)
{
return RT_TRUE;
}
}
-#endif
/* 2、match with name */
if (pdev->name && pdrv->name)
@@ -123,7 +123,13 @@ static rt_err_t platform_probe(rt_device_t dev)
if (err && err != -RT_EEMPTY)
{
- LOG_E("Attach power domain error = %s in device %s", pdev->name, rt_strerror(err));
+ LOG_E("Attach power domain error = %s in device %s", rt_strerror(err),
+ #ifdef RT_USING_OFW
+ (pdev->name && pdev->name[0]) ? pdev->name : rt_ofw_node_full_name(np)
+ #else
+ pdev->name
+ #endif
+ );
return err;
}