linux-2.6-microblaze.git
6 months agoInput: mpr121 - use devm_regulator_get_enable_read_voltage()
David Lechner [Tue, 19 Nov 2024 22:27:40 +0000 (16:27 -0600)]
Input: mpr121 - use devm_regulator_get_enable_read_voltage()

We can reduce boilerplate code by using
devm_regulator_get_enable_read_voltage().

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20241119-input-mpr121-regulator-get-enable-read-voltage-v3-1-1d8ee5c22f6c@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: sun4i-lradc-keys - don't include 'pm_wakeup.h' directly
Wolfram Sang [Mon, 18 Nov 2024 07:29:05 +0000 (08:29 +0100)]
Input: sun4i-lradc-keys - don't include 'pm_wakeup.h' directly

The header clearly states that it does not want to be included directly,
only via 'device.h'. 'platform_device.h' works equally well. Remove the
direct inclusion.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20241118072917.3853-7-wsa+renesas@sang-engineering.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: spear-keyboard - don't include 'pm_wakeup.h' directly
Wolfram Sang [Mon, 18 Nov 2024 07:29:04 +0000 (08:29 +0100)]
Input: spear-keyboard - don't include 'pm_wakeup.h' directly

The header clearly states that it does not want to be included directly,
only via 'device.h'. 'platform_device.h' works equally well. Remove the
direct inclusion.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20241118072917.3853-6-wsa+renesas@sang-engineering.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: cypress-sf - constify struct i2c_device_id
Christophe JAILLET [Fri, 15 Nov 2024 16:50:37 +0000 (17:50 +0100)]
Input: cypress-sf - constify struct i2c_device_id

'struct i2c_device_id' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
   6438     618       0    7056    1b90 drivers/input/keyboard/cypress-sf.o

After:
=====
   text    data     bss     dec     hex filename
   6502     554       0    7056    1b90 drivers/input/keyboard/cypress-sf.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/4bc3e3b4d10223d9df850fe4ba48f1cefd197082.1731689418.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: ads7846 - increase xfer array size in 'struct ser_req'
Nathan Chancellor [Mon, 11 Nov 2024 15:09:55 +0000 (08:09 -0700)]
Input: ads7846 - increase xfer array size in 'struct ser_req'

Clang warns (or errors with CONFIG_WERROR=y, trimmed for brevity):

  drivers/input/touchscreen/ads7846.c:412:2: error: array index 6 is past the end of the array (that has type 'struct spi_transfer[6]') [-Werror,-Warray-bounds]
    412 |         req->xfer[6].tx_buf = &req->scratch;
        |         ^         ~
  ...
  drivers/input/touchscreen/ads7846.c:416:2: error: array index 7 is past the end of the array (that has type 'struct spi_transfer[6]') [-Werror,-Warray-bounds]
    416 |         req->xfer[7].rx_buf = &req->scratch;
        |         ^         ~
  drivers/input/touchscreen/ads7846.c:334:2: note: array 'xfer' declared here
    334 |         struct spi_transfer     xfer[6];
        |         ^

Increase the size of xfer in 'struct ser_req' to ensure that there is
enough space for all necessary members and there are no out of bounds
accesses, clearing up the warning.

Fixes: 781a07da9bb9 ("Input: ads7846 - add dummy command register clearing cycle")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20241111-input-ads7846-increase-xfer-array-size-v1-1-06cd92e9f20f@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: fix the input_event struct documentation
Maud Spierings [Sun, 10 Nov 2024 18:05:02 +0000 (19:05 +0100)]
Input: fix the input_event struct documentation

Fix the datatype of the value field of the input_event struct which is
signed instead of unsigned.

Signed-off-by: Maud Spierings <maud_spierings@hotmail.com>
Link: https://lore.kernel.org/r/20241110-fix_input_doc-v1-1-745d5f908e61@hotmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: i8042 - fix typo dublicate to duplicate
Shivam Chaudhary [Thu, 7 Nov 2024 17:49:18 +0000 (23:19 +0530)]
Input: i8042 - fix typo dublicate to duplicate

Fix typo in i8042-acpipnpio.h dublicate -> duplicate.

Signed-off-by: Shivam Chaudhary <cvam0000@gmail.com>
Link: https://lore.kernel.org/r/20241107174918.78335-1-cvam0000@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: ads7846 - add dummy command register clearing cycle
Marek Vasut [Wed, 20 Mar 2024 07:23:07 +0000 (08:23 +0100)]
Input: ads7846 - add dummy command register clearing cycle

On STM32MP135F with XPT2046 touch controller attached to SPI bus, it has
been observed that the touch controller locks up after Linux kernel has
finished booting. Adding a dummy cycle on the SPI bus seems to mitigate
the lock up.

The XPTEK XPT2046 controller seems to be an identical clone of TI TSC2046,
the datasheet seems to be a clone of the TI part as well, text seem to be
word to word identical, except all the pictures have been drawn again.

This touch controller is present e.g. on WaveShare 3.2inch RPi LCD (B)
panel, the DTO provided by WaveShare uses 50 kHz SPI clock for this
touch controller, which is unusually low and possibly might have been
used as some sort of workaround for an issue. The SPI LCD on the same
bus uses 16 MHz clock.

SPI bus DT properties spi-cs-setup-delay-ns, spi-cs-hold-delay-ns,
spi-cs-inactive-delay-ns, spi-rx-delay-us, spi-tx-delay-us set to
range of 500ns..5us seem to have no impact on the behavior of the
touch controller, the lock up always occurs. The STM32MP13xx SPI
controller users GPIO control for the nCS pins.

Since the dummy cycle happens after the controller has been put into
power down mode and both ADC and REF regulators have been disabled,
the cycle should have no impact on the configuration of the controller,
i.e. it should be a NOP.

It is unclear whether this problem is specific to this cloned XPT2046
controller, or whether this is also present on TSC2046. A test on
either TSC2046 or ADS7846 would be very welcome.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20240320072533.170029-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: introduce notion of passive observers for input handlers
Dmitry Torokhov [Wed, 23 Oct 2024 18:45:24 +0000 (11:45 -0700)]
Input: introduce notion of passive observers for input handlers

Sometimes it is useful to observe (and maybe modify) data coming from
an input device, but only do that if there are other users of such input
device. An example is touchpad switching functionality on Lenovo IdeaPad
Z570 where it is desirable to suppress events coming from the touchpad
if user toggles touchpad on/off button (on this laptop the firmware does
not stop the device).

Introduce notion of passive observers for input handlers to solve this
issue. An input handler marked as passive observer behaves exactly like
any other input handler or filter, but with one exception: it does not
open/start underlying input device when attaching to it.

Link: https://lore.kernel.org/r/ZxlEROX7bMo5cbZP@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: maple_keyb - use guard notation when acquiring mutex
Dmitry Torokhov [Mon, 28 Oct 2024 05:50:18 +0000 (22:50 -0700)]
Input: maple_keyb - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/Zx8mGiWOw1Av28TX@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: locomokbd - use guard notation when acquiring spinlock
Dmitry Torokhov [Fri, 25 Oct 2024 01:44:32 +0000 (18:44 -0700)]
Input: locomokbd - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/Zxr4AMJrzhZlHAlf@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: hilkbd - use guard notation when acquiring spinlock
Dmitry Torokhov [Fri, 25 Oct 2024 01:43:44 +0000 (18:43 -0700)]
Input: hilkbd - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/Zxr30BpPobpM65vO@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: synaptics-rmi4 - switch to using cleanup functions in F34
Dmitry Torokhov [Fri, 25 Oct 2024 22:38:45 +0000 (15:38 -0700)]
Input: synaptics-rmi4 - switch to using cleanup functions in F34

Start using __free() and guard() primitives to simplify the code
and error handling.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/Zxwd9c0njasZZoal@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: synaptics - fix a typo
Christophe JAILLET [Sat, 2 Nov 2024 09:11:24 +0000 (10:11 +0100)]
Input: synaptics - fix a typo

s/synatics/synaptics/
A 'p' is missing.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f3365eab359feb9adc6e2dedcffc976f3b272d8b.1730538673.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agodt-bindings: input: rotary-encoder: Fix "rotary-encoder,rollover" type
Rob Herring (Arm) [Fri, 1 Nov 2024 21:13:03 +0000 (16:13 -0500)]
dt-bindings: input: rotary-encoder: Fix "rotary-encoder,rollover" type

The user and driver both indicate this property is a boolean, not int32.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20241101211304.20886-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: omap-keypad - use guard notation when acquiring mutex
Dmitry Torokhov [Fri, 25 Oct 2024 01:47:08 +0000 (18:47 -0700)]
Input: omap-keypad - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/Zxr4nF-igbrmgq85@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: imagis - fix warning regarding 'imagis_3038_data' being unused
Zeng Heng [Wed, 23 Oct 2024 21:21:05 +0000 (14:21 -0700)]
Input: imagis - fix warning regarding 'imagis_3038_data' being unused

Fix the following compilation warnings:
drivers/input/touchscreen/imagis.c:422:39: warning: ‘imagis_3038c_data’
defined but not used [-Wunused-const-variable=]
  422 | static const struct imagis_properties imagis_3038c_data = {
drivers/input/touchscreen/imagis.c:415:39: warning: ‘imagis_3038b_data’
defined but not used [-Wunused-const-variable=]
  415 | static const struct imagis_properties imagis_3038b_data = {
drivers/input/touchscreen/imagis.c:407:39: warning: ‘imagis_3038_data’
defined but not used [-Wunused-const-variable=]
  407 | static const struct imagis_properties imagis_3038_data = {
drivers/input/touchscreen/imagis.c:398:39: warning: ‘imagis_3032c_data’
defined but not used [-Wunused-const-variable=]
  398 | static const struct imagis_properties imagis_3032c_data = {

Only define the variables 'imagis_303*_data' when the CONFIG_OF
is enabled.

Fixes: 1e48ee99f603 ("Input: imagis - add supports for Imagis IST3038")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Acked-by: Markuss Broks <markuss.broks@gmail.com>
Link: https://lore.kernel.org/r/20241023094831.1680214-1-zengheng4@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: userio - remove unneeded semicolon
Yang Li [Tue, 22 Oct 2024 06:40:56 +0000 (14:40 +0800)]
Input: userio - remove unneeded semicolon

Remove a redundant semicolon from the code.

./drivers/input/serio/userio.c:89:35-36: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11431
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241022064056.112575-1-yang.lee@linux.alibaba.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: sparcspkr - use cleanup facility for device_node
Javier Carrasco [Mon, 21 Oct 2024 20:28:24 +0000 (22:28 +0200)]
Input: sparcspkr - use cleanup facility for device_node

Use the 'free(device_node)' macro to simplify the code by automatically
freeing the device node, which removes the need for explicit calls to
'of_node_put()'.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20241021-input_automate_of_node_put-v3-2-cc73f636e1bc@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: sparcspkr - use device managed memory for 'state'
Javier Carrasco [Mon, 21 Oct 2024 20:28:23 +0000 (22:28 +0200)]
Input: sparcspkr - use device managed memory for 'state'

Use devm_kzalloc() in bbc_bee_probe() and grover_beep_probe() to
automatically free 'state' when the device is removed. Drop the
kfree(state) calls from the probe error paths and the remove functions
accordingly.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241021-input_automate_of_node_put-v3-1-cc73f636e1bc@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agodt-bindings: input: mediatek,pmic-keys: Add compatible for MT6359 keys
AngeloGioacchino Del Regno [Tue, 8 Oct 2024 07:41:37 +0000 (09:41 +0200)]
dt-bindings: input: mediatek,pmic-keys: Add compatible for MT6359 keys

Add a compatible for the keys found on the MT6359 PMIC.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Link: https://lore.kernel.org/r/20241008074137.20269-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: serio_raw - fix uninitialized variable bug
Dmitry Torokhov [Mon, 21 Oct 2024 07:04:05 +0000 (00:04 -0700)]
Input: serio_raw - fix uninitialized variable bug

Recent conversion of the driver to use guard notation for locks and
other resources introduced a bug: "written" variable that is supposed to
hold number of bytes successfully written was not initialized.

Fix it by initializing the variable with 0.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410201730.ItNhUTIv-lkp@intel.com/
Fixes: 5b53a9d40c4f ("Input: serio_raw - use guard notation for locks and other resources")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: ts4800-ts - use cleanup facility for device_node
Javier Carrasco [Sun, 20 Oct 2024 04:18:57 +0000 (21:18 -0700)]
Input: ts4800-ts - use cleanup facility for device_node

Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-10-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: raspberrypi-ts - use cleanup facility for device_node
Javier Carrasco [Sun, 20 Oct 2024 04:18:30 +0000 (21:18 -0700)]
Input: raspberrypi-ts - use cleanup facility for device_node

Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-9-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: i8042 - use cleanup facility for device_node
Javier Carrasco [Sun, 20 Oct 2024 04:15:41 +0000 (21:15 -0700)]
Input: i8042 - use cleanup facility for device_node

Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-8-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: 88pm860x - use cleanup facility for device_node
Javier Carrasco [Sun, 20 Oct 2024 04:14:57 +0000 (21:14 -0700)]
Input: 88pm860x - use cleanup facility for device_node

Use the '__free(device_node)' macro to simplify the code and error
handling. This makes the code more robust by ensuring that the device
node is always freed.

Drop the first assignment to 'pdev->dev.parent->of_node', as it was only
a shortcut, and tie 'np' to its usage as a child node.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-7-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: twl4030-vibra - use cleanup facility for device_node
Javier Carrasco [Sun, 20 Oct 2024 04:07:41 +0000 (21:07 -0700)]
Input: twl4030-vibra - use cleanup facility for device_node

Use the '__free(device_node)' macro to simplify the code by
automatically freeing the device node.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-5-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: twl6040-vibra - use cleanup facility for device_node
Javier Carrasco [Sun, 20 Oct 2024 04:07:19 +0000 (21:07 -0700)]
Input: twl6040-vibra - use cleanup facility for device_node

Use the '__free(device_node)' macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that the
device node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-4-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: sun4i-lradc-keys - switch to for_each_child_of_node_scoped
Javier Carrasco [Sun, 20 Oct 2024 04:01:07 +0000 (21:01 -0700)]
Input: sun4i-lradc-keys - switch to for_each_child_of_node_scoped

Use the scoped variant of the macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that
the child node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-3-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: mtk-pmic-keys - switch to for_each_child_of_node_scoped
Javier Carrasco [Sun, 20 Oct 2024 03:59:49 +0000 (20:59 -0700)]
Input: mtk-pmic-keys - switch to for_each_child_of_node_scoped

Use the scoped variant of the macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that
the child node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-2-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: cap11xx - switch to for_each_child_of_node_scoped
Javier Carrasco [Sun, 20 Oct 2024 03:59:02 +0000 (20:59 -0700)]
Input: cap11xx - switch to for_each_child_of_node_scoped

Use the scoped variant of the macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that
the child node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-1-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: gscps2 - fix compilation error introduced with switch to guards
Dmitry Torokhov [Sat, 19 Oct 2024 21:07:42 +0000 (14:07 -0700)]
Input: gscps2 - fix compilation error introduced with switch to guards

Change 44f920069911 ("Input: gscps2 - use guard notation when acquiring
spinlock") introduced typos resulting in compile errors noticed by the
kernel test robot. Fix them.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410192242.GL0CoAbv-lkp@intel.com/
Fixes: 44f920069911 ("Input: gscps2 - use guard notation when acquiring spinlock")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: switch back to struct platform_driver::remove()
Uwe Kleine-König [Tue, 8 Oct 2024 09:00:10 +0000 (11:00 +0200)]
Input: switch back to struct platform_driver::remove()

After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/input/ to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.

While touching these files, make indention of the struct initializer
consistent in a few drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20241008090009.462836-2-u.kleine-koenig@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: matrix_keypad - remove duplicated include
Yang Li [Tue, 10 Sep 2024 01:01:33 +0000 (09:01 +0800)]
Input: matrix_keypad - remove duplicated include

The header files consumer.h is included twice in matrix_keypad.c,
so one inclusion of each can be removed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=10823
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240910010133.44579-1-yang.lee@linux.alibaba.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: xilinx_ps2 - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:29 +0000 (21:17 -0700)]
Input: xilinx_ps2 - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-25-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: userio - switch to using cleanup functions
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:28 +0000 (21:17 -0700)]
Input: userio - switch to using cleanup functions

Use __free() and guard() primitives to simplify the code and error
handling.

Link: https://lore.kernel.org/r/20240905041732.2034348-24-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: sun4i-ps2 - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:27 +0000 (21:17 -0700)]
Input: sun4i-ps2 - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-23-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: serio-raw - fix potential serio port name truncation
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:26 +0000 (21:17 -0700)]
Input: serio-raw - fix potential serio port name truncation

When compiling with W=1 the following warnings are triggered:

drivers/input/serio/serio_raw.c: In function ‘serio_raw_connect’:
drivers/input/serio/serio_raw.c:303:28: error: ‘%ld’ directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Werror=format-truncation=]
  303 |                  "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no));

atomic_inc_return() returns an int, so there is no reason to cast it
to long and print as such. Fix the issue by removing the cast,
printing it as unsigned decimal, and expanding the name from 16 to 20
bytes to accommodate the largest possible port number.

Link: https://lore.kernel.org/r/20240905041732.2034348-22-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: serio_raw - use guard notation for locks and other resources
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:25 +0000 (21:17 -0700)]
Input: serio_raw - use guard notation for locks and other resources

Use guard notation when acquiring mutexes and spinlocks, and when
pausing and resuming serio port. Such guard notation makes the code
more compact and error handling more robust by ensuring that locks
are released in all code paths when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-21-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: serio - use guard notation when acquiring mutexes and spinlocks
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:24 +0000 (21:17 -0700)]
Input: serio - use guard notation when acquiring mutexes and spinlocks

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-20-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: serport - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:23 +0000 (21:17 -0700)]
Input: serport - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-19-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: sa1111ps2 - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:22 +0000 (21:17 -0700)]
Input: sa1111ps2 - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-18-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: q40kbd - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:21 +0000 (21:17 -0700)]
Input: q40kbd - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-17-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ps2mult - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:20 +0000 (21:17 -0700)]
Input: ps2mult - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-16-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ps2-gpio - use guard notation when acquiring mutex
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:19 +0000 (21:17 -0700)]
Input: ps2-gpio - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-15-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: i8042 - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:18 +0000 (21:17 -0700)]
Input: i8042 - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-14-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: i8042 - tease apart interrupt handler
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:17 +0000 (21:17 -0700)]
Input: i8042 - tease apart interrupt handler

In preparation to using guard notation when acquiring mutexes and
spinlocks factor out handling of active multiplexing mode from
i8042_interrupt().

Link: https://lore.kernel.org/r/20240905041732.2034348-13-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: hyperv-keyboard - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:16 +0000 (21:17 -0700)]
Input: hyperv-keyboard - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-12-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: gscps2 - use guard notation when acquiring spinlock
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:15 +0000 (21:17 -0700)]
Input: gscps2 - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: elo - use guard notation when pausing serio port
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:14 +0000 (21:17 -0700)]
Input: elo - use guard notation when pausing serio port

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: synaptics-rmi4 - use guard notation when pausing serio port in F03
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:13 +0000 (21:17 -0700)]
Input: synaptics-rmi4 - use guard notation when pausing serio port in F03

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: sunkbd - use guard notation when pausing serio port
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:12 +0000 (21:17 -0700)]
Input: sunkbd - use guard notation when pausing serio port

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: atkbd - use guard notation when pausing serio port
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:11 +0000 (21:17 -0700)]
Input: atkbd - use guard notation when pausing serio port

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: synaptics - use guard notation when pausing serio port
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:10 +0000 (21:17 -0700)]
Input: synaptics - use guard notation when pausing serio port

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: byd - use guard notation when pausing serio port
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:09 +0000 (21:17 -0700)]
Input: byd - use guard notation when pausing serio port

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: alps - use guard notation when pausing serio port
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:08 +0000 (21:17 -0700)]
Input: alps - use guard notation when pausing serio port

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Acked-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20240905041732.2034348-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: libps2 - use guard notation when temporarily pausing serio ports
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:07 +0000 (21:17 -0700)]
Input: libps2 - use guard notation when temporarily pausing serio ports

Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: serio - define serio_pause_rx guard to pause and resume serio ports
Dmitry Torokhov [Thu, 5 Sep 2024 04:17:06 +0000 (21:17 -0700)]
Input: serio - define serio_pause_rx guard to pause and resume serio ports

serio_pause_rx() and serio_continue_rx() are usually used together to
temporarily stop receiving interrupts/data for a given serio port.
Define "serio_pause_rx" guard for this so that the port is always
resumed once critical section is over.

Example:

scoped_guard(serio_pause_rx, elo->serio) {
elo->expected_packet = toupper(packet[0]);
init_completion(&elo->cmd_done);
}

Link: https://lore.kernel.org/r/20240905041732.2034348-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: sparcspkr - use guard notation when acquiring spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:49:37 +0000 (21:49 -0700)]
Input: sparcspkr - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044938.1049843-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: rotary_encoder - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:49:29 +0000 (21:49 -0700)]
Input: rotary_encoder - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044929.1049700-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: regulator-haptic - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 20:55:07 +0000 (13:55 -0700)]
Input: regulator-haptic - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/ZtjJKxQRRzJE0aWZ@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: pwm-beeper - use guard notation when acquiring spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:49:12 +0000 (21:49 -0700)]
Input: pwm-beeper - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044914.1049280-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: powermate - use guard notation when acquiring spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:49:00 +0000 (21:49 -0700)]
Input: powermate - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044902.1049017-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: pegasus_notetaker - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 20:59:18 +0000 (13:59 -0700)]
Input: pegasus_notetaker - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/ZtjKJsArLu3byTU6@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: max8997_haptic - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:48:33 +0000 (21:48 -0700)]
Input: max8997_haptic - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044834.1048468-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: iqs7222 - use cleanup facility for fwnodes
Dmitry Torokhov [Wed, 4 Sep 2024 04:48:25 +0000 (21:48 -0700)]
Input: iqs7222 - use cleanup facility for fwnodes

Use __free(fwnode_handle) cleanup facility to ensure that references to
acquired fwnodes are dropped at appropriate times automatically.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240904044825.1048256-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: iqs626a - use cleanup facility for fwnodes
Dmitry Torokhov [Wed, 4 Sep 2024 04:48:13 +0000 (21:48 -0700)]
Input: iqs626a - use cleanup facility for fwnodes

Use __free(fwnode_handle) cleanup facility to ensure that references to
acquired fwnodes are dropped at appropriate times automatically.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044814.1048062-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: iqs269a - use cleanup facility for fwnodes
Dmitry Torokhov [Wed, 4 Sep 2024 04:48:05 +0000 (21:48 -0700)]
Input: iqs269a - use cleanup facility for fwnodes

Use __free(fwnode_handle) cleanup facility to ensure that references to
acquired fwnodes are dropped at appropriate times automatically.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044806.1047847-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: iqs269a - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:47:55 +0000 (21:47 -0700)]
Input: iqs269a - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240904044756.1047629-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ibm-panel - use guard notation when acquiring spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:47:33 +0000 (21:47 -0700)]
Input: ibm-panel - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044735.1047285-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ideapad_slidebar - use guard notation when acquiring spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:30 +0000 (21:42 -0700)]
Input: ideapad_slidebar - use guard notation when acquiring spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: drv2667 - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:29 +0000 (21:42 -0700)]
Input: drv2667 - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: drv2665 - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:28 +0000 (21:42 -0700)]
Input: drv2665 - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: drv260x - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:27 +0000 (21:42 -0700)]
Input: drv260x - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: kxtj9 - use guard notation when acquiring mutex/disabling irq
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:26 +0000 (21:42 -0700)]
Input: kxtj9 - use guard notation when acquiring mutex/disabling irq

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released and interrupts are
re-enabled in all code paths when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: da7280 - use guard notation when acquiring mutex and spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:25 +0000 (21:42 -0700)]
Input: da7280 - use guard notation when acquiring mutex and spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: cma3000_d0x - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:24 +0000 (21:42 -0700)]
Input: cma3000_d0x - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: cm109 - use guard notation when acquiring mutex and spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:23 +0000 (21:42 -0700)]
Input: cm109 - use guard notation when acquiring mutex and spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ati_remote2 - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:22 +0000 (21:42 -0700)]
Input: ati_remote2 - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ad714x - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:42:21 +0000 (21:42 -0700)]
Input: ad714x - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: xpad - use guard notation when acquiring mutex and spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:31:03 +0000 (21:31 -0700)]
Input: xpad - use guard notation when acquiring mutex and spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: turbografx - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:31:02 +0000 (21:31 -0700)]
Input: turbografx - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: n64joy - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:31:01 +0000 (21:31 -0700)]
Input: n64joy - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: iforce - use guard notation when acquiring mutex and spinlock
Dmitry Torokhov [Wed, 4 Sep 2024 04:31:00 +0000 (21:31 -0700)]
Input: iforce - use guard notation when acquiring mutex and spinlock

Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: gamecon - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:30:59 +0000 (21:30 -0700)]
Input: gamecon - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: db9 - use guard notation when acquiring mutex
Dmitry Torokhov [Wed, 4 Sep 2024 04:30:58 +0000 (21:30 -0700)]
Input: db9 - use guard notation when acquiring mutex

Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: st-keyscan - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:20 +0000 (22:16 -0700)]
Input: st-keyscan - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-17-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: spear-keyboard - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:19 +0000 (22:16 -0700)]
Input: spear-keyboard - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-16-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: pxa27x_keypad - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:18 +0000 (22:16 -0700)]
Input: pxa27x_keypad - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-15-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: pmic8xxx-keypad - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:17 +0000 (22:16 -0700)]
Input: pmic8xxx-keypad - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-14-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: omap4-keypad - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:16 +0000 (22:16 -0700)]
Input: omap4-keypad - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-13-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: matrix_keypad - use guard notation when acquiring spinlock
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:15 +0000 (22:16 -0700)]
Input: matrix_keypad - use guard notation when acquiring spinlock

This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-12-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: lpc32xx-keys - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:14 +0000 (22:16 -0700)]
Input: lpc32xx-keys - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: lm8323 - use guard notation when acquiring mutexes
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:13 +0000 (22:16 -0700)]
Input: lm8323 - use guard notation when acquiring mutexes

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ipaq-micro-keys - use guard notation when acquiring mutex and spinlock
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:11 +0000 (22:16 -0700)]
Input: ipaq-micro-keys - use guard notation when acquiring mutex and spinlock

This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: imx_keypad - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:10 +0000 (22:16 -0700)]
Input: imx_keypad - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: ep93xx_keypad - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:08 +0000 (22:16 -0700)]
Input: ep93xx_keypad - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: applespi - use guard notation when acquiring spinlock
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:06 +0000 (22:16 -0700)]
Input: applespi - use guard notation when acquiring spinlock

This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: adp5589-keys - use guard notation when acquiring mutex
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:05 +0000 (22:16 -0700)]
Input: adp5589-keys - use guard notation when acquiring mutex

This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: elan_i2c - switch to using cleanup functions
Dmitry Torokhov [Sun, 25 Aug 2024 05:28:43 +0000 (22:28 -0700)]
Input: elan_i2c - switch to using cleanup functions

Start using __free() and guard() primitives to simplify the code
and error handling. This makes the code more compact and error
handling more robust by ensuring that locks are released in all
code paths when control leaves critical section and all allocated
memory is freed.

Link: https://lore.kernel.org/r/ZsrBC7qDbOvAaI-W@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>