Skip to content

Commit

Permalink
Merge tag 'input-for-v6.7-rc0' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

 - a number of input drivers has been converted to use facilities
   provided by the device core to instantiate driver-specific attributes
   instead of using devm_device_add_group() and similar APIs

 - platform input devices have been converted to use remove() callback
   returning void

 - a fix for use-after-free when tearing down a Synaptics RMI device

 - a few flexible arrays in input structures have been annotated with
   __counted_by to help hardening efforts

 - handling of vddio supply in cyttsp5 driver

 - other miscellaneous fixups

* tag 'input-for-v6.7-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (86 commits)
  Input: walkera0701 - use module_parport_driver macro to simplify the code
  Input: synaptics-rmi4 - fix use after free in rmi_unregister_function()
  dt-bindings: input: fsl,scu-key: Document wakeup-source
  Input: cyttsp5 - add handling for vddio regulator
  dt-bindings: input: cyttsp5: document vddio-supply
  Input: tegra-kbc - use device_get_match_data()
  Input: Annotate struct ff_device with __counted_by
  Input: axp20x-pek - avoid needless newline removal
  Input: mt - annotate struct input_mt with __counted_by
  Input: leds - annotate struct input_leds with __counted_by
  Input: evdev - annotate struct evdev_client with __counted_by
  Input: synaptics-rmi4 - replace deprecated strncpy
  Input: wm97xx-core - convert to platform remove callback returning void
  Input: wm831x-ts - convert to platform remove callback returning void
  Input: ti_am335x_tsc - convert to platform remove callback returning void
  Input: sun4i-ts - convert to platform remove callback returning void
  Input: stmpe-ts - convert to platform remove callback returning void
  Input: pcap_ts - convert to platform remove callback returning void
  Input: mc13783_ts - convert to platform remove callback returning void
  Input: mainstone-wm97xx - convert to platform remove callback returning void
  ...
  • Loading branch information
Linus Torvalds committed Nov 9, 2023
2 parents ace92fd + cdd5b5a commit a12deb4
Show file tree
Hide file tree
Showing 91 changed files with 240 additions and 471 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/input/fsl,scu-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ properties:
linux,keycodes:
maxItems: 1

wakeup-source: true

required:
- compatible
- linux,keycodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ properties:
vdd-supply:
description: Regulator for voltage.

vddio-supply:
description: Optional Regulator for I/O voltage.

reset-gpios:
maxItems: 1

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct evdev_client {
bool revoked;
unsigned long *evmasks[EV_CNT];
unsigned int bufsize;
struct input_event buffer[];
struct input_event buffer[] __counted_by(bufsize);
};

static size_t evdev_get_mask_cnt(unsigned int type)
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/input-leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct input_led {
struct input_leds {
struct input_handle handle;
unsigned int num_leds;
struct input_led leds[];
struct input_led leds[] __counted_by(num_leds);
};

static enum led_brightness input_leds_brightness_get(struct led_classdev *cdev)
Expand Down
13 changes: 1 addition & 12 deletions drivers/input/joystick/walkera0701.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,4 @@ static struct parport_driver walkera0701_parport_driver = {
.devmodel = true,
};

static int __init walkera0701_init(void)
{
return parport_register_driver(&walkera0701_parport_driver);
}

static void __exit walkera0701_exit(void)
{
parport_unregister_driver(&walkera0701_parport_driver);
}

module_init(walkera0701_init);
module_exit(walkera0701_exit);
module_parport_driver(walkera0701_parport_driver);
6 changes: 2 additions & 4 deletions drivers/input/keyboard/adp5520-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,22 +168,20 @@ static int adp5520_keys_probe(struct platform_device *pdev)
return 0;
}

static int adp5520_keys_remove(struct platform_device *pdev)
static void adp5520_keys_remove(struct platform_device *pdev)
{
struct adp5520_keys *dev = platform_get_drvdata(pdev);

adp5520_unregister_notifier(dev->master, &dev->notifier,
ADP5520_KP_IEN | ADP5520_KR_IEN);

return 0;
}

static struct platform_driver adp5520_keys_driver = {
.driver = {
.name = "adp5520-keys",
},
.probe = adp5520_keys_probe,
.remove = adp5520_keys_remove,
.remove_new = adp5520_keys_remove,
};
module_platform_driver(adp5520_keys_driver);

Expand Down
16 changes: 5 additions & 11 deletions drivers/input/keyboard/cros_ec_keyb.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,11 @@ static umode_t cros_ec_keyb_attr_is_visible(struct kobject *kobj,
return attr->mode;
}

static const struct attribute_group cros_ec_keyb_attr_group = {
static const struct attribute_group cros_ec_keyb_group = {
.is_visible = cros_ec_keyb_attr_is_visible,
.attrs = cros_ec_keyb_attrs,
};
__ATTRIBUTE_GROUPS(cros_ec_keyb);

static int cros_ec_keyb_probe(struct platform_device *pdev)
{
Expand Down Expand Up @@ -730,12 +731,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
return err;
}

err = devm_device_add_group(dev, &cros_ec_keyb_attr_group);
if (err) {
dev_err(dev, "failed to create attributes: %d\n", err);
return err;
}

ckdev->notifier.notifier_call = cros_ec_keyb_work;
err = blocking_notifier_chain_register(&ckdev->ec->event_notifier,
&ckdev->notifier);
Expand All @@ -748,14 +743,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
return 0;
}

static int cros_ec_keyb_remove(struct platform_device *pdev)
static void cros_ec_keyb_remove(struct platform_device *pdev)
{
struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev);

blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
&ckdev->notifier);

return 0;
}

#ifdef CONFIG_ACPI
Expand All @@ -779,9 +772,10 @@ static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);

static struct platform_driver cros_ec_keyb_driver = {
.probe = cros_ec_keyb_probe,
.remove = cros_ec_keyb_remove,
.remove_new = cros_ec_keyb_remove,
.driver = {
.name = "cros-ec-keyb",
.dev_groups = cros_ec_keyb_groups,
.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/ep93xx_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,9 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
return 0;
}

static int ep93xx_keypad_remove(struct platform_device *pdev)
static void ep93xx_keypad_remove(struct platform_device *pdev)
{
dev_pm_clear_wake_irq(&pdev->dev);

return 0;
}

static struct platform_driver ep93xx_keypad_driver = {
Expand All @@ -321,7 +319,7 @@ static struct platform_driver ep93xx_keypad_driver = {
.pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops),
},
.probe = ep93xx_keypad_probe,
.remove = ep93xx_keypad_remove,
.remove_new = ep93xx_keypad_remove,
};
module_platform_driver(ep93xx_keypad_driver);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/iqs62x-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev)
return ret;
}

static int iqs62x_keys_remove(struct platform_device *pdev)
static void iqs62x_keys_remove(struct platform_device *pdev)
{
struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev);
int ret;
Expand All @@ -319,16 +319,14 @@ static int iqs62x_keys_remove(struct platform_device *pdev)
&iqs62x_keys->notifier);
if (ret)
dev_err(&pdev->dev, "Failed to unregister notifier: %d\n", ret);

return 0;
}

static struct platform_driver iqs62x_keys_platform_driver = {
.driver = {
.name = "iqs62x-keys",
},
.probe = iqs62x_keys_probe,
.remove = iqs62x_keys_remove,
.remove_new = iqs62x_keys_remove,
};
module_platform_driver(iqs62x_keys_platform_driver);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/matrix_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,13 @@ static int matrix_keypad_probe(struct platform_device *pdev)
return err;
}

static int matrix_keypad_remove(struct platform_device *pdev)
static void matrix_keypad_remove(struct platform_device *pdev)
{
struct matrix_keypad *keypad = platform_get_drvdata(pdev);

matrix_keypad_free_gpio(keypad);
input_unregister_device(keypad->input_dev);
kfree(keypad);

return 0;
}

#ifdef CONFIG_OF
Expand All @@ -570,7 +568,7 @@ MODULE_DEVICE_TABLE(of, matrix_keypad_dt_match);

static struct platform_driver matrix_keypad_driver = {
.probe = matrix_keypad_probe,
.remove = matrix_keypad_remove,
.remove_new = matrix_keypad_remove,
.driver = {
.name = "matrix-keypad",
.pm = pm_sleep_ptr(&matrix_keypad_pm_ops),
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/omap-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int omap_kp_probe(struct platform_device *pdev)
return -EINVAL;
}

static int omap_kp_remove(struct platform_device *pdev)
static void omap_kp_remove(struct platform_device *pdev)
{
struct omap_kp *omap_kp = platform_get_drvdata(pdev);

Expand All @@ -303,13 +303,11 @@ static int omap_kp_remove(struct platform_device *pdev)
input_unregister_device(omap_kp->input);

kfree(omap_kp);

return 0;
}

static struct platform_driver omap_kp_driver = {
.probe = omap_kp_probe,
.remove = omap_kp_remove,
.remove_new = omap_kp_remove,
.driver = {
.name = "omap-keypad",
},
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/omap4-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,9 @@ static int omap4_keypad_probe(struct platform_device *pdev)
return 0;
}

static int omap4_keypad_remove(struct platform_device *pdev)
static void omap4_keypad_remove(struct platform_device *pdev)
{
dev_pm_clear_wake_irq(&pdev->dev);

return 0;
}

static const struct of_device_id omap_keypad_dt_match[] = {
Expand All @@ -476,7 +474,7 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match);

static struct platform_driver omap4_keypad_driver = {
.probe = omap4_keypad_probe,
.remove = omap4_keypad_remove,
.remove_new = omap4_keypad_remove,
.driver = {
.name = "omap4-keypad",
.of_match_table = omap_keypad_dt_match,
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/samsung-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static int samsung_keypad_probe(struct platform_device *pdev)
return error;
}

static int samsung_keypad_remove(struct platform_device *pdev)
static void samsung_keypad_remove(struct platform_device *pdev)
{
struct samsung_keypad *keypad = platform_get_drvdata(pdev);

Expand All @@ -453,8 +453,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
input_unregister_device(keypad->input_dev);

clk_unprepare(keypad->clk);

return 0;
}

static int samsung_keypad_runtime_suspend(struct device *dev)
Expand Down Expand Up @@ -589,7 +587,7 @@ MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids);

static struct platform_driver samsung_keypad_driver = {
.probe = samsung_keypad_probe,
.remove = samsung_keypad_remove,
.remove_new = samsung_keypad_remove,
.driver = {
.name = "samsung-keypad",
.of_match_table = of_match_ptr(samsung_keypad_dt_match),
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/sh_keysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static int sh_keysc_probe(struct platform_device *pdev)
return error;
}

static int sh_keysc_remove(struct platform_device *pdev)
static void sh_keysc_remove(struct platform_device *pdev)
{
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);

Expand All @@ -279,8 +279,6 @@ static int sh_keysc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);

kfree(priv);

return 0;
}

static int sh_keysc_suspend(struct device *dev)
Expand Down Expand Up @@ -321,7 +319,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,

static struct platform_driver sh_keysc_device_driver = {
.probe = sh_keysc_probe,
.remove = sh_keysc_remove,
.remove_new = sh_keysc_remove,
.driver = {
.name = "sh_keysc",
.pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops),
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/spear-keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,12 @@ static int spear_kbd_probe(struct platform_device *pdev)
return 0;
}

static int spear_kbd_remove(struct platform_device *pdev)
static void spear_kbd_remove(struct platform_device *pdev)
{
struct spear_kbd *kbd = platform_get_drvdata(pdev);

input_unregister_device(kbd->input);
clk_unprepare(kbd->clk);

return 0;
}

static int spear_kbd_suspend(struct device *dev)
Expand Down Expand Up @@ -375,7 +373,7 @@ MODULE_DEVICE_TABLE(of, spear_kbd_id_table);

static struct platform_driver spear_kbd_driver = {
.probe = spear_kbd_probe,
.remove = spear_kbd_remove,
.remove_new = spear_kbd_remove,
.driver = {
.name = "keyboard",
.pm = pm_sleep_ptr(&spear_kbd_pm_ops),
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/keyboard/stmpe-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,18 @@ static int stmpe_keypad_probe(struct platform_device *pdev)
return 0;
}

static int stmpe_keypad_remove(struct platform_device *pdev)
static void stmpe_keypad_remove(struct platform_device *pdev)
{
struct stmpe_keypad *keypad = platform_get_drvdata(pdev);

stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD);

return 0;
}

static struct platform_driver stmpe_keypad_driver = {
.driver.name = "stmpe-keypad",
.driver.owner = THIS_MODULE,
.probe = stmpe_keypad_probe,
.remove = stmpe_keypad_remove,
.remove_new = stmpe_keypad_remove,
};
module_platform_driver(stmpe_keypad_driver);

Expand Down
7 changes: 2 additions & 5 deletions drivers/input/keyboard/tegra-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/input/matrix_keypad.h>
Expand Down Expand Up @@ -602,9 +602,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
unsigned int debounce_cnt;
unsigned int scan_time_rows;
unsigned int keymap_rows;
const struct of_device_id *match;

match = of_match_device(tegra_kbc_of_match, &pdev->dev);

kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
if (!kbc) {
Expand All @@ -613,7 +610,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
}

kbc->dev = &pdev->dev;
kbc->hw_support = match->data;
kbc->hw_support = device_get_match_data(&pdev->dev);
kbc->max_keys = kbc->hw_support->max_rows *
kbc->hw_support->max_columns;
kbc->num_rows_and_columns = kbc->hw_support->max_rows +
Expand Down
Loading

0 comments on commit a12deb4

Please sign in to comment.