summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>2017-04-07 15:38:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 12:41:39 +0200
commitadd98da7da79f38fd22d8852ed1066952d8b02aa (patch)
treeb3cd9cdf281a951f4b039a29360918ff19dee5b0
parent7dc70220e92fc045ab2357874a67f06a916e0b41 (diff)
staging: most: core: separate property showing links
Currently an AIM has the following properties available to manage links: - write-only "remove_link" used to remove a link from a list - read/write "add_link" used to add a link to a list and display them This patch transfers the read functionality of "add_link" to the new read-only property "links" to build consistent set of properties to control the list of links. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/most/mostcore/core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 720b9ced1a9d..7fc7cb39ea2b 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -831,9 +831,9 @@ static void most_aim_release(struct kobject *kobj)
kfree(aim_obj);
}
-static ssize_t add_link_show(struct most_aim_obj *aim_obj,
- struct most_aim_attribute *attr,
- char *buf)
+static ssize_t links_show(struct most_aim_obj *aim_obj,
+ struct most_aim_attribute *attr,
+ char *buf)
{
struct most_c_obj *c;
struct most_inst_obj *i;
@@ -854,6 +854,9 @@ static ssize_t add_link_show(struct most_aim_obj *aim_obj,
return offs;
}
+static struct most_aim_attribute most_aim_attr_links =
+ __ATTR_RO(links);
+
/**
* split_string - parses and changes string in the buffer buf and
* splits it into two mandatory and one optional substrings.
@@ -998,7 +1001,7 @@ static ssize_t add_link_store(struct most_aim_obj *aim_obj,
}
static struct most_aim_attribute most_aim_attr_add_link =
- __ATTR_RW(add_link);
+ __ATTR_WO(add_link);
/**
* remove_link_store - store function for remove_link attribute
@@ -1044,6 +1047,7 @@ static struct most_aim_attribute most_aim_attr_remove_link =
__ATTR_WO(remove_link);
static struct attribute *most_aim_def_attrs[] = {
+ &most_aim_attr_links.attr,
&most_aim_attr_add_link.attr,
&most_aim_attr_remove_link.attr,
NULL,