diff options
author | James Clark <james.clark@arm.com> | 2023-04-25 16:35:29 +0200 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2023-06-05 16:46:45 +0200 |
commit | 9fa3682869d4e1632f0fb2ed18c4cece101ace57 (patch) | |
tree | b5c91a6f75d31667147b04c6c8ac4731866b0686 /include | |
parent | coresight: Fix loss of connection info when a module is unloaded (diff) | |
download | linux-9fa3682869d4e1632f0fb2ed18c4cece101ace57.tar.xz linux-9fa3682869d4e1632f0fb2ed18c4cece101ace57.zip |
coresight: Use enum type for cs_mode wherever possible
mode is stored as a local_t, but it is also passed around a lot as a
plain u32, so use the correct type wherever local_t isn't currently
used. This helps a little bit with readability.
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: James Clark <james.clark@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230425143542.2305069-3-james.clark@arm.com
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/coresight.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index f19a47b9bb5a..1f878e8ed8c4 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -272,6 +272,12 @@ static struct coresight_dev_list (var) = { \ #define to_coresight_device(d) container_of(d, struct coresight_device, dev) +enum cs_mode { + CS_MODE_DISABLED, + CS_MODE_SYSFS, + CS_MODE_PERF, +}; + #define source_ops(csdev) csdev->ops->source_ops #define sink_ops(csdev) csdev->ops->sink_ops #define link_ops(csdev) csdev->ops->link_ops @@ -288,7 +294,8 @@ static struct coresight_dev_list (var) = { \ * @update_buffer: update buffer pointers after a trace session. */ struct coresight_ops_sink { - int (*enable)(struct coresight_device *csdev, u32 mode, void *data); + int (*enable)(struct coresight_device *csdev, enum cs_mode mode, + void *data); int (*disable)(struct coresight_device *csdev); void *(*alloc_buffer)(struct coresight_device *csdev, struct perf_event *event, void **pages, @@ -320,8 +327,8 @@ struct coresight_ops_link { */ struct coresight_ops_source { int (*cpu_id)(struct coresight_device *csdev); - int (*enable)(struct coresight_device *csdev, - struct perf_event *event, u32 mode); + int (*enable)(struct coresight_device *csdev, struct perf_event *event, + enum cs_mode mode); void (*disable)(struct coresight_device *csdev, struct perf_event *event); }; |