Commit 00b78e8b authored by Suzuki K Poulose's avatar Suzuki K Poulose Committed by Greg Kroah-Hartman

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: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fe470f5f
...@@ -63,17 +63,20 @@ enum coresight_dev_subtype_source { ...@@ -63,17 +63,20 @@ enum coresight_dev_subtype_source {
}; };
/** /**
* struct coresight_dev_subtype - further characterisation of a type * union coresight_dev_subtype - further characterisation of a type
* @sink_subtype: type of sink this component is, as defined * @sink_subtype: type of sink this component is, as defined
by @coresight_dev_subtype_sink. * by @coresight_dev_subtype_sink.
* @link_subtype: type of link this component is, as defined * @link_subtype: type of link this component is, as defined
by @coresight_dev_subtype_link. * by @coresight_dev_subtype_link.
* @source_subtype: type of source this component is, as defined * @source_subtype: type of source this component is, as defined
by @coresight_dev_subtype_source. * by @coresight_dev_subtype_source.
*/ */
struct coresight_dev_subtype { union coresight_dev_subtype {
/* We have some devices which acts as LINK and SINK */
struct {
enum coresight_dev_subtype_sink sink_subtype; enum coresight_dev_subtype_sink sink_subtype;
enum coresight_dev_subtype_link link_subtype; enum coresight_dev_subtype_link link_subtype;
};
enum coresight_dev_subtype_source source_subtype; enum coresight_dev_subtype_source source_subtype;
}; };
...@@ -111,7 +114,7 @@ struct coresight_platform_data { ...@@ -111,7 +114,7 @@ struct coresight_platform_data {
*/ */
struct coresight_desc { struct coresight_desc {
enum coresight_dev_type type; enum coresight_dev_type type;
struct coresight_dev_subtype subtype; union coresight_dev_subtype subtype;
const struct coresight_ops *ops; const struct coresight_ops *ops;
struct coresight_platform_data *pdata; struct coresight_platform_data *pdata;
struct device *dev; struct device *dev;
...@@ -155,7 +158,7 @@ struct coresight_device { ...@@ -155,7 +158,7 @@ struct coresight_device {
int nr_inport; int nr_inport;
int nr_outport; int nr_outport;
enum coresight_dev_type type; enum coresight_dev_type type;
struct coresight_dev_subtype subtype; union coresight_dev_subtype subtype;
const struct coresight_ops *ops; const struct coresight_ops *ops;
struct device dev; struct device dev;
atomic_t *refcnt; atomic_t *refcnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment