aboutsummaryrefslogtreecommitdiff
path: root/src/hid-tmff2.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-10-08 21:46:49 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-10-08 21:46:49 +0300
commit29400ff75b47ef4320c3fccef5860e44fd8f3a62 (patch)
tree96e785d418ebbcead6fc9bc4c789db0a08777c08 /src/hid-tmff2.c
parent3027994d340f09892efa08e22c1f2e1ae6d7010d (diff)
downloadhid-tmff2-29400ff75b47ef4320c3fccef5860e44fd8f3a62.tar.gz
hid-tmff2-29400ff75b47ef4320c3fccef5860e44fd8f3a62.zip
docs: general tidbits
Diffstat (limited to 'src/hid-tmff2.c')
-rw-r--r--src/hid-tmff2.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/hid-tmff2.c b/src/hid-tmff2.c
index 44df1e3..013039f 100644
--- a/src/hid-tmff2.c
+++ b/src/hid-tmff2.c
@@ -101,7 +101,6 @@ static ssize_t spring_level_store(struct device *dev,
static ssize_t spring_level_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
-
return scnprintf(buf, PAGE_SIZE, "%u\n", spring_level);
}
static DEVICE_ATTR_RW(spring_level);
@@ -132,7 +131,6 @@ static ssize_t damper_level_store(struct device *dev,
static ssize_t damper_level_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
-
return scnprintf(buf, PAGE_SIZE, "%u\n", damper_level);
}
static DEVICE_ATTR_RW(damper_level);
@@ -163,12 +161,7 @@ static ssize_t friction_level_store(struct device *dev,
static ssize_t friction_level_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- size_t count;
-
-
- count = scnprintf(buf, PAGE_SIZE, "%u\n", friction_level);
-
- return count;
+ return scnprintf(buf, PAGE_SIZE, "%u\n", friction_level);
}
static DEVICE_ATTR_RW(friction_level);
@@ -179,7 +172,6 @@ static ssize_t range_store(struct device *dev,
unsigned int value;
int ret;
-
if (!tmff2)
return -ENODEV;
@@ -199,7 +191,6 @@ static ssize_t range_store(struct device *dev,
static ssize_t range_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
-
return scnprintf(buf, PAGE_SIZE, "%u\n", range);
}
static DEVICE_ATTR_RW(range);
@@ -333,7 +324,7 @@ static void tmff2_work_handler(struct work_struct *w)
} else {
__clear_bit(FF_EFFECT_QUEUE_UPLOAD, &state->flags);
/* if we're uploading an effect, it's bound to be the up
- * to date available */
+ * to date */
__clear_bit(FF_EFFECT_QUEUE_UPDATE, &state->flags);
}
}
@@ -458,6 +449,8 @@ static void tmff2_close(struct input_dev *dev)
return;
/* since we're closing the device, no need to continue feeding it new data */
+ /* TODO: check somewhere that multiple users can't open us at the same
+ * time */
cancel_delayed_work_sync(&tmff2->work);
if (tmff2->close) {
@@ -620,7 +613,6 @@ static int tmff2_probe(struct hid_device *hdev, const struct hid_device_id *id)
hid_set_drvdata(tmff2->hdev, tmff2);
switch (tmff2->hdev->product) {
- /* t300rs */
case TMT300RS_PS3_NORM_ID:
case TMT300RS_PS3_ADV_ID:
case TMT300RS_PS4_NORM_ID: