mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
driver core: Fix device_link_flag_is_sync_state_only()
commit 7fddac12c38237252431d5b8af7b6d5771b6d125 upstream.
device_link_flag_is_sync_state_only() correctly returns true on the flags
of an existing device link that only implements sync_state() functionality.
However, it incorrectly and confusingly returns false if it's called with
DL_FLAG_SYNC_STATE_ONLY.
This bug doesn't manifest in any of the existing calls to this function,
but fix this confusing behavior to avoid future bugs.
Fixes: 67cad5c670 ("driver core: fw_devlink: Add DL_FLAG_CYCLE support to device links")
Signed-off-by: Saravana Kannan <saravanak@google.com>
Tested-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20240202095636.868578-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
02f2b95b00
commit
0f081fcfaa
@@ -337,10 +337,12 @@ static bool device_is_ancestor(struct device *dev, struct device *target)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define DL_MARKER_FLAGS (DL_FLAG_INFERRED | \
|
||||||
|
DL_FLAG_CYCLE | \
|
||||||
|
DL_FLAG_MANAGED)
|
||||||
static inline bool device_link_flag_is_sync_state_only(u32 flags)
|
static inline bool device_link_flag_is_sync_state_only(u32 flags)
|
||||||
{
|
{
|
||||||
return (flags & ~(DL_FLAG_INFERRED | DL_FLAG_CYCLE)) ==
|
return (flags & ~DL_MARKER_FLAGS) == DL_FLAG_SYNC_STATE_ONLY;
|
||||||
(DL_FLAG_SYNC_STATE_ONLY | DL_FLAG_MANAGED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user