mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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
This commit is contained in:
parent
2a0bc21927
commit
62374ce187
|
|
@ -24,7 +24,7 @@ DEFINE_CORESIGHT_DEVLIST(tpda_devs, "tpda");
|
|||
|
||||
static bool coresight_device_is_tpdm(struct coresight_device *csdev)
|
||||
{
|
||||
return (csdev->type == CORESIGHT_DEV_TYPE_SOURCE) &&
|
||||
return (coresight_is_device_source(csdev)) &&
|
||||
(csdev->subtype.source_subtype ==
|
||||
CORESIGHT_DEV_SUBTYPE_SOURCE_TPDM);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user