All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gromm <christian.gromm@microchip.com>
To: gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org,
	Andrey Shvetsov <andrey.shvetsov@k2l.de>,
	Christian Gromm <christian.gromm@microchip.com>
Subject: [PATCH 08/13] staging: most: separate property showing links
Date: Fri, 31 Mar 2017 15:22:29 +0200	[thread overview]
Message-ID: <20170331132234.21722-8-christian.gromm@microchip.com> (raw)
In-Reply-To: <20170331132234.21722-1-christian.gromm@microchip.com>

From: Andrey Shvetsov <andrey.shvetsov@k2l.de>

Currently there are following properties of the AIM to control the links
to the HDMs:
  - write-only "remove_link" used to remove one link from a list,
  - read/write "add_link" used to add one link into a list and list all
    links.

This patch moves the read functionality of the "add_link" into 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>
---
 drivers/staging/most/mostcore/core.c | 12 ++++++++----
 1 file 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,
-- 
2.11.0

  parent reply	other threads:[~2017-03-31 13:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 13:22 [PATCH 01/13] staging: most: fix comment of the function add_link_store Christian Gromm
2017-03-31 13:22 ` [PATCH 02/13] staging: most: fix comment of the function remove_link_store Christian Gromm
2017-03-31 13:22 ` [PATCH 03/13] staging: most: use __ATTR_RO for the attribute interface Christian Gromm
2017-03-31 13:22 ` [PATCH 04/13] staging: most: use __ATTR_RO for the attribute value Christian Gromm
2017-03-31 13:22 ` [PATCH 05/13] staging: most: use __ATTR_RW in create_channel_attribute Christian Gromm
2017-04-01 21:18   ` kbuild test robot
2017-04-08 10:39   ` Greg KH
2017-03-31 13:22 ` [PATCH 06/13] staging: most: use __ATTR_RO in create_show_channel_attribute Christian Gromm
2017-03-31 13:22 ` [PATCH 07/13] staging: most: consolidate channel attributes Christian Gromm
2017-03-31 13:22 ` Christian Gromm [this message]
2017-03-31 13:22 ` [PATCH 09/13] staging: most: consolidate attributes for list of links Christian Gromm
2017-03-31 13:22 ` [PATCH 10/13] staging: most: destroy cdev by channel disconnect Christian Gromm
2017-03-31 13:22 ` [PATCH 11/13] staging: most: usb: fix calculation of the extra_len Christian Gromm
2017-03-31 13:22 ` [PATCH 12/13] staging: most: usb: fix size overflow Christian Gromm
2017-03-31 13:22 ` [PATCH 13/13] staging: most: usb: Fix setting of writable DCI registers Christian Gromm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170331132234.21722-8-christian.gromm@microchip.com \
    --to=christian.gromm@microchip.com \
    --cc=andrey.shvetsov@k2l.de \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.