Skip to content

Commit a12deb4

Browse files
committed
Merge tag 'input-for-v6.7-rc0' of git://git.kernel.org/pub/scm/linux/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 ...
2 parents ace92fd + cdd5b5a commit a12deb4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+240
-471
lines changed

Documentation/devicetree/bindings/input/fsl,scu-key.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ properties:
2424
linux,keycodes:
2525
maxItems: 1
2626

27+
wakeup-source: true
28+
2729
required:
2830
- compatible
2931
- linux,keycodes

Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ properties:
3434
vdd-supply:
3535
description: Regulator for voltage.
3636

37+
vddio-supply:
38+
description: Optional Regulator for I/O voltage.
39+
3740
reset-gpios:
3841
maxItems: 1
3942

drivers/input/evdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct evdev_client {
5050
bool revoked;
5151
unsigned long *evmasks[EV_CNT];
5252
unsigned int bufsize;
53-
struct input_event buffer[];
53+
struct input_event buffer[] __counted_by(bufsize);
5454
};
5555

5656
static size_t evdev_get_mask_cnt(unsigned int type)

drivers/input/input-leds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct input_led {
4444
struct input_leds {
4545
struct input_handle handle;
4646
unsigned int num_leds;
47-
struct input_led leds[];
47+
struct input_led leds[] __counted_by(num_leds);
4848
};
4949

5050
static enum led_brightness input_leds_brightness_get(struct led_classdev *cdev)

drivers/input/joystick/walkera0701.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,4 @@ static struct parport_driver walkera0701_parport_driver = {
296296
.devmodel = true,
297297
};
298298

299-
static int __init walkera0701_init(void)
300-
{
301-
return parport_register_driver(&walkera0701_parport_driver);
302-
}
303-
304-
static void __exit walkera0701_exit(void)
305-
{
306-
parport_unregister_driver(&walkera0701_parport_driver);
307-
}
308-
309-
module_init(walkera0701_init);
310-
module_exit(walkera0701_exit);
299+
module_parport_driver(walkera0701_parport_driver);

drivers/input/keyboard/adp5520-keys.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,20 @@ static int adp5520_keys_probe(struct platform_device *pdev)
168168
return 0;
169169
}
170170

171-
static int adp5520_keys_remove(struct platform_device *pdev)
171+
static void adp5520_keys_remove(struct platform_device *pdev)
172172
{
173173
struct adp5520_keys *dev = platform_get_drvdata(pdev);
174174

175175
adp5520_unregister_notifier(dev->master, &dev->notifier,
176176
ADP5520_KP_IEN | ADP5520_KR_IEN);
177-
178-
return 0;
179177
}
180178

181179
static struct platform_driver adp5520_keys_driver = {
182180
.driver = {
183181
.name = "adp5520-keys",
184182
},
185183
.probe = adp5520_keys_probe,
186-
.remove = adp5520_keys_remove,
184+
.remove_new = adp5520_keys_remove,
187185
};
188186
module_platform_driver(adp5520_keys_driver);
189187

drivers/input/keyboard/cros_ec_keyb.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,11 @@ static umode_t cros_ec_keyb_attr_is_visible(struct kobject *kobj,
686686
return attr->mode;
687687
}
688688

689-
static const struct attribute_group cros_ec_keyb_attr_group = {
689+
static const struct attribute_group cros_ec_keyb_group = {
690690
.is_visible = cros_ec_keyb_attr_is_visible,
691691
.attrs = cros_ec_keyb_attrs,
692692
};
693+
__ATTRIBUTE_GROUPS(cros_ec_keyb);
693694

694695
static int cros_ec_keyb_probe(struct platform_device *pdev)
695696
{
@@ -730,12 +731,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
730731
return err;
731732
}
732733

733-
err = devm_device_add_group(dev, &cros_ec_keyb_attr_group);
734-
if (err) {
735-
dev_err(dev, "failed to create attributes: %d\n", err);
736-
return err;
737-
}
738-
739734
ckdev->notifier.notifier_call = cros_ec_keyb_work;
740735
err = blocking_notifier_chain_register(&ckdev->ec->event_notifier,
741736
&ckdev->notifier);
@@ -748,14 +743,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
748743
return 0;
749744
}
750745

751-
static int cros_ec_keyb_remove(struct platform_device *pdev)
746+
static void cros_ec_keyb_remove(struct platform_device *pdev)
752747
{
753748
struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev);
754749

755750
blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
756751
&ckdev->notifier);
757-
758-
return 0;
759752
}
760753

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

780773
static struct platform_driver cros_ec_keyb_driver = {
781774
.probe = cros_ec_keyb_probe,
782-
.remove = cros_ec_keyb_remove,
775+
.remove_new = cros_ec_keyb_remove,
783776
.driver = {
784777
.name = "cros-ec-keyb",
778+
.dev_groups = cros_ec_keyb_groups,
785779
.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
786780
.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
787781
.pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),

drivers/input/keyboard/ep93xx_keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,9 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
308308
return 0;
309309
}
310310

311-
static int ep93xx_keypad_remove(struct platform_device *pdev)
311+
static void ep93xx_keypad_remove(struct platform_device *pdev)
312312
{
313313
dev_pm_clear_wake_irq(&pdev->dev);
314-
315-
return 0;
316314
}
317315

318316
static struct platform_driver ep93xx_keypad_driver = {
@@ -321,7 +319,7 @@ static struct platform_driver ep93xx_keypad_driver = {
321319
.pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops),
322320
},
323321
.probe = ep93xx_keypad_probe,
324-
.remove = ep93xx_keypad_remove,
322+
.remove_new = ep93xx_keypad_remove,
325323
};
326324
module_platform_driver(ep93xx_keypad_driver);
327325

drivers/input/keyboard/iqs62x-keys.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev)
310310
return ret;
311311
}
312312

313-
static int iqs62x_keys_remove(struct platform_device *pdev)
313+
static void iqs62x_keys_remove(struct platform_device *pdev)
314314
{
315315
struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev);
316316
int ret;
@@ -319,16 +319,14 @@ static int iqs62x_keys_remove(struct platform_device *pdev)
319319
&iqs62x_keys->notifier);
320320
if (ret)
321321
dev_err(&pdev->dev, "Failed to unregister notifier: %d\n", ret);
322-
323-
return 0;
324322
}
325323

326324
static struct platform_driver iqs62x_keys_platform_driver = {
327325
.driver = {
328326
.name = "iqs62x-keys",
329327
},
330328
.probe = iqs62x_keys_probe,
331-
.remove = iqs62x_keys_remove,
329+
.remove_new = iqs62x_keys_remove,
332330
};
333331
module_platform_driver(iqs62x_keys_platform_driver);
334332

drivers/input/keyboard/matrix_keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,15 +549,13 @@ static int matrix_keypad_probe(struct platform_device *pdev)
549549
return err;
550550
}
551551

552-
static int matrix_keypad_remove(struct platform_device *pdev)
552+
static void matrix_keypad_remove(struct platform_device *pdev)
553553
{
554554
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
555555

556556
matrix_keypad_free_gpio(keypad);
557557
input_unregister_device(keypad->input_dev);
558558
kfree(keypad);
559-
560-
return 0;
561559
}
562560

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

571569
static struct platform_driver matrix_keypad_driver = {
572570
.probe = matrix_keypad_probe,
573-
.remove = matrix_keypad_remove,
571+
.remove_new = matrix_keypad_remove,
574572
.driver = {
575573
.name = "matrix-keypad",
576574
.pm = pm_sleep_ptr(&matrix_keypad_pm_ops),

drivers/input/keyboard/omap-keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static int omap_kp_probe(struct platform_device *pdev)
287287
return -EINVAL;
288288
}
289289

290-
static int omap_kp_remove(struct platform_device *pdev)
290+
static void omap_kp_remove(struct platform_device *pdev)
291291
{
292292
struct omap_kp *omap_kp = platform_get_drvdata(pdev);
293293

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

305305
kfree(omap_kp);
306-
307-
return 0;
308306
}
309307

310308
static struct platform_driver omap_kp_driver = {
311309
.probe = omap_kp_probe,
312-
.remove = omap_kp_remove,
310+
.remove_new = omap_kp_remove,
313311
.driver = {
314312
.name = "omap-keypad",
315313
},

drivers/input/keyboard/omap4-keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,9 @@ static int omap4_keypad_probe(struct platform_device *pdev)
461461
return 0;
462462
}
463463

464-
static int omap4_keypad_remove(struct platform_device *pdev)
464+
static void omap4_keypad_remove(struct platform_device *pdev)
465465
{
466466
dev_pm_clear_wake_irq(&pdev->dev);
467-
468-
return 0;
469467
}
470468

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

477475
static struct platform_driver omap4_keypad_driver = {
478476
.probe = omap4_keypad_probe,
479-
.remove = omap4_keypad_remove,
477+
.remove_new = omap4_keypad_remove,
480478
.driver = {
481479
.name = "omap4-keypad",
482480
.of_match_table = omap_keypad_dt_match,

drivers/input/keyboard/samsung-keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static int samsung_keypad_probe(struct platform_device *pdev)
444444
return error;
445445
}
446446

447-
static int samsung_keypad_remove(struct platform_device *pdev)
447+
static void samsung_keypad_remove(struct platform_device *pdev)
448448
{
449449
struct samsung_keypad *keypad = platform_get_drvdata(pdev);
450450

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

455455
clk_unprepare(keypad->clk);
456-
457-
return 0;
458456
}
459457

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

590588
static struct platform_driver samsung_keypad_driver = {
591589
.probe = samsung_keypad_probe,
592-
.remove = samsung_keypad_remove,
590+
.remove_new = samsung_keypad_remove,
593591
.driver = {
594592
.name = "samsung-keypad",
595593
.of_match_table = of_match_ptr(samsung_keypad_dt_match),

drivers/input/keyboard/sh_keysc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int sh_keysc_probe(struct platform_device *pdev)
265265
return error;
266266
}
267267

268-
static int sh_keysc_remove(struct platform_device *pdev)
268+
static void sh_keysc_remove(struct platform_device *pdev)
269269
{
270270
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
271271

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

281281
kfree(priv);
282-
283-
return 0;
284282
}
285283

286284
static int sh_keysc_suspend(struct device *dev)
@@ -321,7 +319,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
321319

322320
static struct platform_driver sh_keysc_device_driver = {
323321
.probe = sh_keysc_probe,
324-
.remove = sh_keysc_remove,
322+
.remove_new = sh_keysc_remove,
325323
.driver = {
326324
.name = "sh_keysc",
327325
.pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops),

drivers/input/keyboard/spear-keyboard.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,12 @@ static int spear_kbd_probe(struct platform_device *pdev)
272272
return 0;
273273
}
274274

275-
static int spear_kbd_remove(struct platform_device *pdev)
275+
static void spear_kbd_remove(struct platform_device *pdev)
276276
{
277277
struct spear_kbd *kbd = platform_get_drvdata(pdev);
278278

279279
input_unregister_device(kbd->input);
280280
clk_unprepare(kbd->clk);
281-
282-
return 0;
283281
}
284282

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

376374
static struct platform_driver spear_kbd_driver = {
377375
.probe = spear_kbd_probe,
378-
.remove = spear_kbd_remove,
376+
.remove_new = spear_kbd_remove,
379377
.driver = {
380378
.name = "keyboard",
381379
.pm = pm_sleep_ptr(&spear_kbd_pm_ops),

drivers/input/keyboard/stmpe-keypad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,20 +404,18 @@ static int stmpe_keypad_probe(struct platform_device *pdev)
404404
return 0;
405405
}
406406

407-
static int stmpe_keypad_remove(struct platform_device *pdev)
407+
static void stmpe_keypad_remove(struct platform_device *pdev)
408408
{
409409
struct stmpe_keypad *keypad = platform_get_drvdata(pdev);
410410

411411
stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD);
412-
413-
return 0;
414412
}
415413

416414
static struct platform_driver stmpe_keypad_driver = {
417415
.driver.name = "stmpe-keypad",
418416
.driver.owner = THIS_MODULE,
419417
.probe = stmpe_keypad_probe,
420-
.remove = stmpe_keypad_remove,
418+
.remove_new = stmpe_keypad_remove,
421419
};
422420
module_platform_driver(stmpe_keypad_driver);
423421

drivers/input/keyboard/tegra-kbc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/io.h>
1515
#include <linux/interrupt.h>
1616
#include <linux/of.h>
17-
#include <linux/of_device.h>
17+
#include <linux/property.h>
1818
#include <linux/clk.h>
1919
#include <linux/slab.h>
2020
#include <linux/input/matrix_keypad.h>
@@ -602,9 +602,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
602602
unsigned int debounce_cnt;
603603
unsigned int scan_time_rows;
604604
unsigned int keymap_rows;
605-
const struct of_device_id *match;
606-
607-
match = of_match_device(tegra_kbc_of_match, &pdev->dev);
608605

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

615612
kbc->dev = &pdev->dev;
616-
kbc->hw_support = match->data;
613+
kbc->hw_support = device_get_match_data(&pdev->dev);
617614
kbc->max_keys = kbc->hw_support->max_rows *
618615
kbc->hw_support->max_columns;
619616
kbc->num_rows_and_columns = kbc->hw_support->max_rows +

0 commit comments

Comments
 (0)