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: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Johan Hovold 2016-07-19 15:24:47 +02:00 committed by Greg Kroah-Hartman
parent 1bb61840c4
commit 441ac1fa9e

View file

@ -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,
&dev_attr_interface_type.attr,
NULL,
NULL
};
static struct attribute *interface_common_attrs[] = {
&dev_attr_interface_type.attr,
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)
{