From: "Michal Malý" <madcatxster@devoid-pointer.net>
To: jkosina@suse.cz
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
elias.vds@gmail.com, simon@mungewell.org,
"Michal Malý" <madcatxster@devoid-pointer.net>
Subject: [PATCH 03/12] HID: hid-lg4ff: (Cleanup) Replace DEVICE_ATTR_RW with DEVICE_ATTR to have all internal functions prefixed with "lg4ff_"
Date: Sat, 21 Mar 2015 12:47:33 +0100 [thread overview]
Message-ID: <1426938462-884-4-git-send-email-madcatxster@devoid-pointer.net> (raw)
In-Reply-To: <1426938462-884-1-git-send-email-madcatxster@devoid-pointer.net>
All internal functions should be prefixed with just "lg4ff_". Usage of
DEVICE_ATTR_RW breaks this scheme because it expects the functions'
names to match the name of the respective sysfs entry.
This partially reverts "2f1cec3250e38609bf9252db52dbbe61603c04a7"
Signed-off-by: Michal Malý <madcatxster@devoid-pointer.net>
---
drivers/hid/hid-lg4ff.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 9a0c0e5..cec84a5 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -721,9 +721,9 @@ static ssize_t lg4ff_alternate_modes_store(struct device *dev, struct device_att
}
static DEVICE_ATTR(alternate_modes, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, lg4ff_alternate_modes_show, lg4ff_alternate_modes_store);
-/* Read current range and display it in terminal */
-static ssize_t range_show(struct device *dev, struct device_attribute *attr,
- char *buf)
+/* Export the currently set range of the wheel */
+static ssize_t lg4ff_range_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
struct hid_device *hid = to_hid_device(dev);
struct lg4ff_device_entry *entry;
@@ -748,8 +748,8 @@ static ssize_t range_show(struct device *dev, struct device_attribute *attr,
/* Set range to user specified value, call appropriate function
* according to the type of the wheel */
-static ssize_t range_store(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
+static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct hid_device *hid = to_hid_device(dev);
struct lg4ff_device_entry *entry;
@@ -780,7 +780,7 @@ static ssize_t range_store(struct device *dev, struct device_attribute *attr,
return count;
}
-static DEVICE_ATTR_RW(range);
+static DEVICE_ATTR(range, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, lg4ff_range_show, lg4ff_range_store);
static ssize_t lg4ff_real_id_show(struct device *dev, struct device_attribute *attr, char *buf)
{
--
2.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-03-21 11:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-21 11:47 [PATCH 00/12] HID: hid-lg, hid-lg4ff: Mostly cleanup patches Michal Malý
2015-03-21 11:47 ` [PATCH 01/12] HID: hid-lg4ff: (Cleanup) Remove double underscore prefix from numeric types Michal Malý
2015-03-21 11:47 ` [PATCH 02/12] HID: hid-lg4ff: (Cleanup) Remove "hid_" prefix from some functions names Michal Malý
2015-03-21 11:47 ` Michal Malý [this message]
2015-03-21 11:47 ` [PATCH 04/12] HID: hid-lg4ff: (Cleanup) Remove unused variable from the "lg4ff_device_entry" struct Michal Malý
2015-03-21 11:47 ` [PATCH 05/12] HID: hid-lg4ff: Update a warning message for a case where device is incorrectly flagged to be handled by hid-lg4ff in hid-lg Michal Malý
2015-03-31 14:38 ` Jiri Kosina
2015-03-21 11:47 ` [PATCH 06/12] HID: hid-lg: Check return values from lg[N]ff_init() Michal Malý
2015-03-21 11:47 ` [PATCH 07/12] HID: hid-lg4ff: Protect concurrent access to the output HID report values with a spinlock Michal Malý
2015-03-31 14:44 ` Jiri Kosina
2015-03-21 11:47 ` [PATCH 08/12] HID: hid-lg4ff: Store pointer to the output HID report struct in the device entry struct Michal Malý
2015-03-21 11:47 ` [PATCH 09/12] HID: hid-lg4ff: Constify those members of lg4ff_device_entry struct whose value is not supposed to change Michal Malý
2015-03-21 11:47 ` [PATCH 10/12] HID: hid-lg4ff: Allow the driver to continue without sysfs interface Michal Malý
2015-03-21 11:47 ` [PATCH 11/12] HID: hid-lg4ff: Update respective sysfs interface documentation Michal Malý
2015-03-21 11:47 ` [PATCH 12/12] HID: hid-lg: Only one of LG_FF flags can be set for a given device Michal Malý
2015-03-29 9:01 ` [PATCH 00/12] HID: hid-lg, hid-lg4ff: Mostly cleanup patches Elias Vanderstuyft
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=1426938462-884-4-git-send-email-madcatxster@devoid-pointer.net \
--to=madcatxster@devoid-pointer.net \
--cc=elias.vds@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simon@mungewell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).