Skip to content
Snippets Groups Projects
Commit c7840750 authored by Florian Pose's avatar Florian Pose
Browse files

Slave (special) type in SysFS

parent 2727be57
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ EC_SYSFS_READ_ATTR(station_address);
EC_SYSFS_READ_ATTR(vendor_name);
EC_SYSFS_READ_ATTR(product_name);
EC_SYSFS_READ_ATTR(product_desc);
EC_SYSFS_READ_ATTR(type);
static struct attribute *def_attrs[] = {
&attr_ring_position,
......@@ -40,6 +41,7 @@ static struct attribute *def_attrs[] = {
&attr_vendor_name,
&attr_product_name,
&attr_product_desc,
&attr_type,
NULL,
};
......@@ -1224,6 +1226,14 @@ ssize_t ec_show_slave_attribute(struct kobject *kobj, /**< KObject */
if (slave->type)
return sprintf(buffer, "%s\n", slave->type->description);
}
else if (attr == &attr_type) {
if (slave->type) {
if (slave->type->special == EC_TYPE_BUS_COUPLER)
return sprintf(buffer, "coupler\n");
else
return sprintf(buffer, "normal\n");
}
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment