From: Aaron Armstrong Skomra <skomra@gmail.com>
To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
benjamin.tissoires@redhat.com, jikos@kernel.org
Cc: pinglinux@gmail.com, skomra@gmail.com, Joshua@Joshua-Dickens.com,
jason.gerecke@wacom.com,
Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Subject: [PATCH Wacom EKR Battery Fixes 2/3] HID: wacom: remove unnecessary 'connected' variable from EKR
Date: Tue, 25 Jul 2023 15:20:57 -0700 [thread overview]
Message-ID: <20230725222057.123863-1-skomra@gmail.com> (raw)
From: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
The 'connected' variable was poorly named, and this has led to some
confusion. We can get the same information by checking if a serial number
exists in the specified EKR slot.
Signed-off-by: Aaron Skomra <skomra@gmail.com>
Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
---
drivers/hid/wacom_sys.c | 2 +-
drivers/hid/wacom_wac.c | 2 --
drivers/hid/wacom_wac.h | 1 -
3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index eb833455abd5..16862f97c46c 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2684,7 +2684,7 @@ static void wacom_remote_work(struct work_struct *work)
for (i = 0; i < WACOM_MAX_REMOTES; i++) {
serial = data.remote[i].serial;
- if (data.remote[i].connected) {
+ if (serial) {
if (kt - remote->remotes[i].active_time > WACOM_REMOTE_BATTERY_TIMEOUT
&& remote->remotes[i].active_time != 0)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 6c056f8844e7..c922c1c4c78f 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1209,10 +1209,8 @@ static void wacom_remote_status_irq(struct wacom_wac *wacom_wac, size_t len)
for (i = 0; i < WACOM_MAX_REMOTES; i++) {
int j = i * 6;
int serial = (data[j+6] << 16) + (data[j+5] << 8) + data[j+4];
- bool connected = data[j+2];
remote_data.remote[i].serial = serial;
- remote_data.remote[i].connected = connected;
}
spin_lock_irqsave(&remote->remote_lock, flags);
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
index 2e7cc5e7a0cb..a10b19669947 100644
--- a/drivers/hid/wacom_wac.h
+++ b/drivers/hid/wacom_wac.h
@@ -331,7 +331,6 @@ struct hid_data {
struct wacom_remote_data {
struct {
u32 serial;
- bool connected;
} remote[WACOM_MAX_REMOTES];
};
--
2.34.1
reply other threads:[~2023-07-25 22:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230725222057.123863-1-skomra@gmail.com \
--to=skomra@gmail.com \
--cc=Joshua@Joshua-Dickens.com \
--cc=aaron.skomra@wacom.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jason.gerecke@wacom.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pinglinux@gmail.com \
/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).