Skip to content

Commit

Permalink
HID: wacom: remove unnecessary 'connected' variable from EKR
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Aaron Armstrong Skomra authored and Jiri Kosina committed Aug 14, 2023
1 parent 9ac6678 commit 2834e38
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion drivers/hid/wacom_wac.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ struct hid_data {
struct wacom_remote_data {
struct {
u32 serial;
bool connected;
} remote[WACOM_MAX_REMOTES];
};

Expand Down

0 comments on commit 2834e38

Please sign in to comment.