summaryrefslogtreecommitdiff
path: root/drivers/core/device-remove.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2020-11-15 23:22:53 +0300
committerSimon Glass <sjg@chromium.org>2020-11-30 23:14:43 +0300
commite7e7e1093b5243b058c420eaebf9373cf2d3f270 (patch)
treee4a17626c802d7a7d527c58b1824cbfe30c14538 /drivers/core/device-remove.c
parent87d07ccc237a5bfd8be119af46140a4467122ca7 (diff)
downloadu-boot-e7e7e1093b5243b058c420eaebf9373cf2d3f270.tar.xz
dm: core: Fix incorrect flag check
The test should be checking whether $flags are non-zero and $drv_flags contain specific flags, however these two sets of flags are separate, and the two tests should be logically ANDed, not bitwise ANDed. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device-remove.c')
-rw-r--r--drivers/core/device-remove.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index efdb0f2905..0924a575f5 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -152,7 +152,7 @@ void device_free(struct udevice *dev)
static bool flags_remove(uint flags, uint drv_flags)
{
if ((flags & DM_REMOVE_NORMAL) ||
- (flags & (drv_flags & (DM_FLAG_ACTIVE_DMA | DM_FLAG_OS_PREPARE))))
+ (flags && (drv_flags & (DM_FLAG_ACTIVE_DMA | DM_FLAG_OS_PREPARE))))
return true;
return false;