diff options
author | 2024-12-13 18:07:29 +0800 | |
---|---|---|
committer | 2024-12-13 10:25:14 +0000 | |
commit | 62374ce1876be26b3f33575680e67ca69a59db54 (patch) | |
tree | 1de43bb8f16e0985caf4120e65875801716a8f12 /include/linux/coresight.h | |
parent | dt-bindings: arm: qcom,coresight-static-replicator: Add property for source filtering (diff) | |
download | wireguard-linux-62374ce1876be26b3f33575680e67ca69a59db54.tar.xz wireguard-linux-62374ce1876be26b3f33575680e67ca69a59db54.zip |
coresight: Add a helper to check if a device is source
Since there are a lot of places in the code to check whether the
device is source, add a helper to check it.
Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20241213100731.25914-3-quic_taozha@quicinc.com
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r-- | include/linux/coresight.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 055ce5cd5c44..c50d128e8d93 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -588,9 +588,14 @@ static inline void csdev_access_write64(struct csdev_access *csa, u64 val, u32 o } #endif /* CONFIG_64BIT */ +static inline bool coresight_is_device_source(struct coresight_device *csdev) +{ + return csdev && (csdev->type == CORESIGHT_DEV_TYPE_SOURCE); +} + static inline bool coresight_is_percpu_source(struct coresight_device *csdev) { - return csdev && (csdev->type == CORESIGHT_DEV_TYPE_SOURCE) && + return csdev && coresight_is_device_source(csdev) && (csdev->subtype.source_subtype == CORESIGHT_DEV_SUBTYPE_SOURCE_PROC); } |