Commit 441ac1fa authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: interface: partition attribute group

Partition the current attribute group into four groups for UniPro,
Greybus, power and common attributes.

This is a step in refining the interface-type handling as attributes are
type dependent.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 1bb61840
......@@ -512,20 +512,55 @@ static ssize_t interface_type_show(struct device *dev,
}
static DEVICE_ATTR_RO(interface_type);
static struct attribute *interface_attrs[] = {
static struct attribute *interface_unipro_attrs[] = {
&dev_attr_ddbl1_manufacturer_id.attr,
&dev_attr_ddbl1_product_id.attr,
NULL
};
static struct attribute *interface_greybus_attrs[] = {
&dev_attr_interface_id.attr,
&dev_attr_vendor_id.attr,
&dev_attr_product_id.attr,
&dev_attr_serial_number.attr,
NULL
};
static struct attribute *interface_power_attrs[] = {
&dev_attr_voltage_now.attr,
&dev_attr_current_now.attr,
&dev_attr_power_now.attr,
NULL
};
static struct attribute *interface_common_attrs[] = {
&dev_attr_interface_type.attr,
NULL,
NULL
};
static const struct attribute_group interface_unipro_group = {
.attrs = interface_unipro_attrs,
};
static const struct attribute_group interface_greybus_group = {
.attrs = interface_greybus_attrs,
};
static const struct attribute_group interface_power_group = {
.attrs = interface_power_attrs,
};
static const struct attribute_group interface_common_group = {
.attrs = interface_common_attrs,
};
static const struct attribute_group *interface_groups[] = {
&interface_unipro_group,
&interface_greybus_group,
&interface_power_group,
&interface_common_group,
NULL
};
ATTRIBUTE_GROUPS(interface);
static void gb_interface_release(struct device *dev)
{
......
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