mirror of
https://xff.cz/git/u-boot/
synced 2025-10-26 16:13:55 +01:00
dm: add DM_FLAG_BOUND flag
Currently, we only have DM_FLAG_ACTIVATED to indicate the device status, but we still cannot know in which stage is in progress, binding or probing. This commit introduces a new flag, DM_FLAG_BOUND, which is set when the device is really bound, and cleared when it is unbound. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Simon Glass
parent
f33017716e
commit
aed1a4dd88
@@ -61,6 +61,9 @@ int device_unbind(struct udevice *dev)
|
|||||||
if (dev->flags & DM_FLAG_ACTIVATED)
|
if (dev->flags & DM_FLAG_ACTIVATED)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (!(dev->flags & DM_FLAG_BOUND))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
drv = dev->driver;
|
drv = dev->driver;
|
||||||
assert(drv);
|
assert(drv);
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ int device_bind(struct udevice *parent, const struct driver *drv,
|
|||||||
dm_dbg("Bound device %s to %s\n", dev->name, parent->name);
|
dm_dbg("Bound device %s to %s\n", dev->name, parent->name);
|
||||||
*devp = dev;
|
*devp = dev;
|
||||||
|
|
||||||
|
dev->flags |= DM_FLAG_BOUND;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_child_post_bind:
|
fail_child_post_bind:
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ struct driver_info;
|
|||||||
/* Allocate driver private data on a DMA boundary */
|
/* Allocate driver private data on a DMA boundary */
|
||||||
#define DM_FLAG_ALLOC_PRIV_DMA (1 << 5)
|
#define DM_FLAG_ALLOC_PRIV_DMA (1 << 5)
|
||||||
|
|
||||||
|
/* Device is bound */
|
||||||
|
#define DM_FLAG_BOUND (1 << 6)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct udevice - An instance of a driver
|
* struct udevice - An instance of a driver
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user