diff options
author | Suzuki K Poulose <suzuki.poulose@arm.com> | 2018-07-11 15:40:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-15 07:52:58 -0400 |
commit | 00b78e8b7b003c686a8570df7d231787f514226c (patch) | |
tree | be82baa58bf81d526b2f7510d1389097d04b5875 /include | |
parent | fe470f5f7f684ed15bc49b6183a64237547910ff (diff) |
coresight: Cleanup device subtype struct
Clean up our struct a little bit by using a union instead of
a struct for tracking the subtype of a device.
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/coresight.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 69a5c9f82469..7c188c2a5b3c 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h | |||
@@ -63,17 +63,20 @@ enum coresight_dev_subtype_source { | |||
63 | }; | 63 | }; |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * struct coresight_dev_subtype - further characterisation of a type | 66 | * union coresight_dev_subtype - further characterisation of a type |
67 | * @sink_subtype: type of sink this component is, as defined | 67 | * @sink_subtype: type of sink this component is, as defined |
68 | by @coresight_dev_subtype_sink. | 68 | * by @coresight_dev_subtype_sink. |
69 | * @link_subtype: type of link this component is, as defined | 69 | * @link_subtype: type of link this component is, as defined |
70 | by @coresight_dev_subtype_link. | 70 | * by @coresight_dev_subtype_link. |
71 | * @source_subtype: type of source this component is, as defined | 71 | * @source_subtype: type of source this component is, as defined |
72 | by @coresight_dev_subtype_source. | 72 | * by @coresight_dev_subtype_source. |
73 | */ | 73 | */ |
74 | struct coresight_dev_subtype { | 74 | union coresight_dev_subtype { |
75 | enum coresight_dev_subtype_sink sink_subtype; | 75 | /* We have some devices which acts as LINK and SINK */ |
76 | enum coresight_dev_subtype_link link_subtype; | 76 | struct { |
77 | enum coresight_dev_subtype_sink sink_subtype; | ||
78 | enum coresight_dev_subtype_link link_subtype; | ||
79 | }; | ||
77 | enum coresight_dev_subtype_source source_subtype; | 80 | enum coresight_dev_subtype_source source_subtype; |
78 | }; | 81 | }; |
79 | 82 | ||
@@ -111,7 +114,7 @@ struct coresight_platform_data { | |||
111 | */ | 114 | */ |
112 | struct coresight_desc { | 115 | struct coresight_desc { |
113 | enum coresight_dev_type type; | 116 | enum coresight_dev_type type; |
114 | struct coresight_dev_subtype subtype; | 117 | union coresight_dev_subtype subtype; |
115 | const struct coresight_ops *ops; | 118 | const struct coresight_ops *ops; |
116 | struct coresight_platform_data *pdata; | 119 | struct coresight_platform_data *pdata; |
117 | struct device *dev; | 120 | struct device *dev; |
@@ -155,7 +158,7 @@ struct coresight_device { | |||
155 | int nr_inport; | 158 | int nr_inport; |
156 | int nr_outport; | 159 | int nr_outport; |
157 | enum coresight_dev_type type; | 160 | enum coresight_dev_type type; |
158 | struct coresight_dev_subtype subtype; | 161 | union coresight_dev_subtype subtype; |
159 | const struct coresight_ops *ops; | 162 | const struct coresight_ops *ops; |
160 | struct device dev; | 163 | struct device dev; |
161 | atomic_t *refcnt; | 164 | atomic_t *refcnt; |