From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Christian Gromm Subject: [PATCH 04/13] staging: most: use __ATTR_RO for the attribute value Date: Fri, 31 Mar 2017 15:22:25 +0200 Message-ID: <20170331132234.21722-4-christian.gromm@microchip.com> In-Reply-To: <20170331132234.21722-1-christian.gromm@microchip.com> References: <20170331132234.21722-1-christian.gromm@microchip.com> MIME-Version: 1.0 Content-Type: text/plain List-ID: To: gregkh@linuxfoundation.org Cc: driverdev-devel@linuxdriverproject.org, Andrey Shvetsov , Christian Gromm From: Andrey Shvetsov This patch replaces the use of a macro create_inst_attribute for the attribute value with a macro __ATTR_RO. Additionally, this patch removes not anymore used macros MOST_INST_ATTR and create_inst_attribute. Signed-off-by: Andrey Shvetsov Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index a9fd896c9a9e..f3a2dc4f4b47 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -562,9 +562,6 @@ create_most_c_obj(const char *name, struct kobject *parent) /* ___ ___ * ___I N S T A N C E___ */ -#define MOST_INST_ATTR(_name, _mode, _show, _store) \ - struct most_inst_attribute most_inst_attr_##_name = \ - __ATTR(_name, _mode, _show, _store) static struct list_head instance_list; @@ -652,7 +649,7 @@ static void most_inst_release(struct kobject *kobj) kfree(inst); } -static ssize_t show_description(struct most_inst_obj *instance_obj, +static ssize_t description_show(struct most_inst_obj *instance_obj, struct most_inst_attribute *attr, char *buf) { @@ -687,10 +684,8 @@ static ssize_t interface_show(struct most_inst_obj *instance_obj, return snprintf(buf, PAGE_SIZE, "unknown\n"); } -#define create_inst_attribute(value) \ - static MOST_INST_ATTR(value, 0444, show_##value, NULL) - -create_inst_attribute(description); +static struct most_inst_attribute most_inst_attr_description = + __ATTR_RO(description); static struct most_inst_attribute most_inst_attr_interface = __ATTR_RO(interface); -- 2.11.0