From aed1a4dd88e94001b811b297c1ff734c3f8d22d9 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 25 Jul 2015 21:52:34 +0900 Subject: 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 Acked-by: Simon Glass --- drivers/core/device-remove.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/core/device-remove.c') diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c index 6b87f865e40..45d6543067b 100644 --- a/drivers/core/device-remove.c +++ b/drivers/core/device-remove.c @@ -61,6 +61,9 @@ int device_unbind(struct udevice *dev) if (dev->flags & DM_FLAG_ACTIVATED) return -EINVAL; + if (!(dev->flags & DM_FLAG_BOUND)) + return -EINVAL; + drv = dev->driver; assert(drv); -- cgit v1.2.3