From 66e522e26549afab26d032e900ae9f6576c83b9d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 26 Jan 2026 18:21:43 +0200 Subject: Revert "use on_hid_hw_open instead of input_dev->open" This reverts commit c26573d77369c042dc2b9a881a7f2ff88ddc0dd9. + `on_hid_hw_open` is apparently new enough that common distros don't have it yet, so let's wait a few years and try again. The old method works well enough and if not, just set `open_mode=0`. --- src/tmtsxw/hid-tmtsxw.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/tmtsxw') diff --git a/src/tmtsxw/hid-tmtsxw.c b/src/tmtsxw/hid-tmtsxw.c index ac44bdb..b8ee1fd 100644 --- a/src/tmtsxw/hid-tmtsxw.c +++ b/src/tmtsxw/hid-tmtsxw.c @@ -196,15 +196,17 @@ static int tsxw_send_open(struct t300rs_device_entry *tsxw) return 0; } -static void tsxw_open(void *data, int open_mode) +static int tsxw_open(void *data, int open_mode) { struct t300rs_device_entry *tsxw = data; if (!tsxw) - return; + return -ENODEV; if (open_mode) tsxw_send_open(tsxw); + + return tsxw->open(tsxw->input_dev); } static int tsxw_send_close(struct t300rs_device_entry *tsxw) @@ -223,15 +225,18 @@ static int tsxw_send_close(struct t300rs_device_entry *tsxw) return 0; } -static void tsxw_close(void *data, int open_mode) +static int tsxw_close(void *data, int open_mode) { struct t300rs_device_entry *tsxw = data; if (!tsxw) - return; + return -ENODEV; if (open_mode) tsxw_send_close(tsxw); + + tsxw->close(tsxw->input_dev); + return 0; } static int tsxw_wheel_init(struct tmff2_device_entry *tmff2, int open_mode) @@ -262,6 +267,9 @@ static int tsxw_wheel_init(struct tmff2_device_entry *tmff2, int open_mode) tsxw->report = list_entry(report_list->next, struct hid_report, list); tsxw->ff_field = tsxw->report->field[0]; + tsxw->open = tsxw->input_dev->open; + tsxw->close = tsxw->input_dev->close; + if ((ret = tsxw_interrupts(tsxw))) goto interrupt_err; -- cgit v1.3