Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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
...

+240 -471
+2
Documentation/devicetree/bindings/input/fsl,scu-key.yaml
··· 24 24 linux,keycodes: 25 25 maxItems: 1 26 26 27 + wakeup-source: true 28 + 27 29 required: 28 30 - compatible 29 31 - linux,keycodes
+3
Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml
··· 34 34 vdd-supply: 35 35 description: Regulator for voltage. 36 36 37 + vddio-supply: 38 + description: Optional Regulator for I/O voltage. 39 + 37 40 reset-gpios: 38 41 maxItems: 1 39 42
+1 -1
drivers/input/evdev.c
··· 50 50 bool revoked; 51 51 unsigned long *evmasks[EV_CNT]; 52 52 unsigned int bufsize; 53 - struct input_event buffer[]; 53 + struct input_event buffer[] __counted_by(bufsize); 54 54 }; 55 55 56 56 static size_t evdev_get_mask_cnt(unsigned int type)
+1 -1
drivers/input/input-leds.c
··· 44 44 struct input_leds { 45 45 struct input_handle handle; 46 46 unsigned int num_leds; 47 - struct input_led leds[]; 47 + struct input_led leds[] __counted_by(num_leds); 48 48 }; 49 49 50 50 static enum led_brightness input_leds_brightness_get(struct led_classdev *cdev)
+1 -12
drivers/input/joystick/walkera0701.c
··· 296 296 .devmodel = true, 297 297 }; 298 298 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);
+2 -4
drivers/input/keyboard/adp5520-keys.c
··· 168 168 return 0; 169 169 } 170 170 171 - static int adp5520_keys_remove(struct platform_device *pdev) 171 + static void adp5520_keys_remove(struct platform_device *pdev) 172 172 { 173 173 struct adp5520_keys *dev = platform_get_drvdata(pdev); 174 174 175 175 adp5520_unregister_notifier(dev->master, &dev->notifier, 176 176 ADP5520_KP_IEN | ADP5520_KR_IEN); 177 - 178 - return 0; 179 177 } 180 178 181 179 static struct platform_driver adp5520_keys_driver = { ··· 181 183 .name = "adp5520-keys", 182 184 }, 183 185 .probe = adp5520_keys_probe, 184 - .remove = adp5520_keys_remove, 186 + .remove_new = adp5520_keys_remove, 185 187 }; 186 188 module_platform_driver(adp5520_keys_driver); 187 189
+5 -11
drivers/input/keyboard/cros_ec_keyb.c
··· 686 686 return attr->mode; 687 687 } 688 688 689 - static const struct attribute_group cros_ec_keyb_attr_group = { 689 + static const struct attribute_group cros_ec_keyb_group = { 690 690 .is_visible = cros_ec_keyb_attr_is_visible, 691 691 .attrs = cros_ec_keyb_attrs, 692 692 }; 693 + __ATTRIBUTE_GROUPS(cros_ec_keyb); 693 694 694 695 static int cros_ec_keyb_probe(struct platform_device *pdev) 695 696 { ··· 731 730 return err; 732 731 } 733 732 734 - err = devm_device_add_group(dev, &cros_ec_keyb_attr_group); 735 - if (err) { 736 - dev_err(dev, "failed to create attributes: %d\n", err); 737 - return err; 738 - } 739 - 740 733 ckdev->notifier.notifier_call = cros_ec_keyb_work; 741 734 err = blocking_notifier_chain_register(&ckdev->ec->event_notifier, 742 735 &ckdev->notifier); ··· 743 748 return 0; 744 749 } 745 750 746 - static int cros_ec_keyb_remove(struct platform_device *pdev) 751 + static void cros_ec_keyb_remove(struct platform_device *pdev) 747 752 { 748 753 struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev); 749 754 750 755 blocking_notifier_chain_unregister(&ckdev->ec->event_notifier, 751 756 &ckdev->notifier); 752 - 753 - return 0; 754 757 } 755 758 756 759 #ifdef CONFIG_ACPI ··· 772 779 773 780 static struct platform_driver cros_ec_keyb_driver = { 774 781 .probe = cros_ec_keyb_probe, 775 - .remove = cros_ec_keyb_remove, 782 + .remove_new = cros_ec_keyb_remove, 776 783 .driver = { 777 784 .name = "cros-ec-keyb", 785 + .dev_groups = cros_ec_keyb_groups, 778 786 .of_match_table = of_match_ptr(cros_ec_keyb_of_match), 779 787 .acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match), 780 788 .pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
+2 -4
drivers/input/keyboard/ep93xx_keypad.c
··· 308 308 return 0; 309 309 } 310 310 311 - static int ep93xx_keypad_remove(struct platform_device *pdev) 311 + static void ep93xx_keypad_remove(struct platform_device *pdev) 312 312 { 313 313 dev_pm_clear_wake_irq(&pdev->dev); 314 - 315 - return 0; 316 314 } 317 315 318 316 static struct platform_driver ep93xx_keypad_driver = { ··· 319 321 .pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops), 320 322 }, 321 323 .probe = ep93xx_keypad_probe, 322 - .remove = ep93xx_keypad_remove, 324 + .remove_new = ep93xx_keypad_remove, 323 325 }; 324 326 module_platform_driver(ep93xx_keypad_driver); 325 327
+2 -4
drivers/input/keyboard/iqs62x-keys.c
··· 310 310 return ret; 311 311 } 312 312 313 - static int iqs62x_keys_remove(struct platform_device *pdev) 313 + static void iqs62x_keys_remove(struct platform_device *pdev) 314 314 { 315 315 struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev); 316 316 int ret; ··· 319 319 &iqs62x_keys->notifier); 320 320 if (ret) 321 321 dev_err(&pdev->dev, "Failed to unregister notifier: %d\n", ret); 322 - 323 - return 0; 324 322 } 325 323 326 324 static struct platform_driver iqs62x_keys_platform_driver = { ··· 326 328 .name = "iqs62x-keys", 327 329 }, 328 330 .probe = iqs62x_keys_probe, 329 - .remove = iqs62x_keys_remove, 331 + .remove_new = iqs62x_keys_remove, 330 332 }; 331 333 module_platform_driver(iqs62x_keys_platform_driver); 332 334
+2 -4
drivers/input/keyboard/matrix_keypad.c
··· 549 549 return err; 550 550 } 551 551 552 - static int matrix_keypad_remove(struct platform_device *pdev) 552 + static void matrix_keypad_remove(struct platform_device *pdev) 553 553 { 554 554 struct matrix_keypad *keypad = platform_get_drvdata(pdev); 555 555 556 556 matrix_keypad_free_gpio(keypad); 557 557 input_unregister_device(keypad->input_dev); 558 558 kfree(keypad); 559 - 560 - return 0; 561 559 } 562 560 563 561 #ifdef CONFIG_OF ··· 568 570 569 571 static struct platform_driver matrix_keypad_driver = { 570 572 .probe = matrix_keypad_probe, 571 - .remove = matrix_keypad_remove, 573 + .remove_new = matrix_keypad_remove, 572 574 .driver = { 573 575 .name = "matrix-keypad", 574 576 .pm = pm_sleep_ptr(&matrix_keypad_pm_ops),
+2 -4
drivers/input/keyboard/omap-keypad.c
··· 287 287 return -EINVAL; 288 288 } 289 289 290 - static int omap_kp_remove(struct platform_device *pdev) 290 + static void omap_kp_remove(struct platform_device *pdev) 291 291 { 292 292 struct omap_kp *omap_kp = platform_get_drvdata(pdev); 293 293 ··· 303 303 input_unregister_device(omap_kp->input); 304 304 305 305 kfree(omap_kp); 306 - 307 - return 0; 308 306 } 309 307 310 308 static struct platform_driver omap_kp_driver = { 311 309 .probe = omap_kp_probe, 312 - .remove = omap_kp_remove, 310 + .remove_new = omap_kp_remove, 313 311 .driver = { 314 312 .name = "omap-keypad", 315 313 },
+2 -4
drivers/input/keyboard/omap4-keypad.c
··· 461 461 return 0; 462 462 } 463 463 464 - static int omap4_keypad_remove(struct platform_device *pdev) 464 + static void omap4_keypad_remove(struct platform_device *pdev) 465 465 { 466 466 dev_pm_clear_wake_irq(&pdev->dev); 467 - 468 - return 0; 469 467 } 470 468 471 469 static const struct of_device_id omap_keypad_dt_match[] = { ··· 474 476 475 477 static struct platform_driver omap4_keypad_driver = { 476 478 .probe = omap4_keypad_probe, 477 - .remove = omap4_keypad_remove, 479 + .remove_new = omap4_keypad_remove, 478 480 .driver = { 479 481 .name = "omap4-keypad", 480 482 .of_match_table = omap_keypad_dt_match,
+2 -4
drivers/input/keyboard/samsung-keypad.c
··· 444 444 return error; 445 445 } 446 446 447 - static int samsung_keypad_remove(struct platform_device *pdev) 447 + static void samsung_keypad_remove(struct platform_device *pdev) 448 448 { 449 449 struct samsung_keypad *keypad = platform_get_drvdata(pdev); 450 450 ··· 453 453 input_unregister_device(keypad->input_dev); 454 454 455 455 clk_unprepare(keypad->clk); 456 - 457 - return 0; 458 456 } 459 457 460 458 static int samsung_keypad_runtime_suspend(struct device *dev) ··· 587 589 588 590 static struct platform_driver samsung_keypad_driver = { 589 591 .probe = samsung_keypad_probe, 590 - .remove = samsung_keypad_remove, 592 + .remove_new = samsung_keypad_remove, 591 593 .driver = { 592 594 .name = "samsung-keypad", 593 595 .of_match_table = of_match_ptr(samsung_keypad_dt_match),
+2 -4
drivers/input/keyboard/sh_keysc.c
··· 265 265 return error; 266 266 } 267 267 268 - static int sh_keysc_remove(struct platform_device *pdev) 268 + static void sh_keysc_remove(struct platform_device *pdev) 269 269 { 270 270 struct sh_keysc_priv *priv = platform_get_drvdata(pdev); 271 271 ··· 279 279 pm_runtime_disable(&pdev->dev); 280 280 281 281 kfree(priv); 282 - 283 - return 0; 284 282 } 285 283 286 284 static int sh_keysc_suspend(struct device *dev) ··· 319 321 320 322 static struct platform_driver sh_keysc_device_driver = { 321 323 .probe = sh_keysc_probe, 322 - .remove = sh_keysc_remove, 324 + .remove_new = sh_keysc_remove, 323 325 .driver = { 324 326 .name = "sh_keysc", 325 327 .pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops),
+2 -4
drivers/input/keyboard/spear-keyboard.c
··· 272 272 return 0; 273 273 } 274 274 275 - static int spear_kbd_remove(struct platform_device *pdev) 275 + static void spear_kbd_remove(struct platform_device *pdev) 276 276 { 277 277 struct spear_kbd *kbd = platform_get_drvdata(pdev); 278 278 279 279 input_unregister_device(kbd->input); 280 280 clk_unprepare(kbd->clk); 281 - 282 - return 0; 283 281 } 284 282 285 283 static int spear_kbd_suspend(struct device *dev) ··· 373 375 374 376 static struct platform_driver spear_kbd_driver = { 375 377 .probe = spear_kbd_probe, 376 - .remove = spear_kbd_remove, 378 + .remove_new = spear_kbd_remove, 377 379 .driver = { 378 380 .name = "keyboard", 379 381 .pm = pm_sleep_ptr(&spear_kbd_pm_ops),
+2 -4
drivers/input/keyboard/stmpe-keypad.c
··· 404 404 return 0; 405 405 } 406 406 407 - static int stmpe_keypad_remove(struct platform_device *pdev) 407 + static void stmpe_keypad_remove(struct platform_device *pdev) 408 408 { 409 409 struct stmpe_keypad *keypad = platform_get_drvdata(pdev); 410 410 411 411 stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD); 412 - 413 - return 0; 414 412 } 415 413 416 414 static struct platform_driver stmpe_keypad_driver = { 417 415 .driver.name = "stmpe-keypad", 418 416 .driver.owner = THIS_MODULE, 419 417 .probe = stmpe_keypad_probe, 420 - .remove = stmpe_keypad_remove, 418 + .remove_new = stmpe_keypad_remove, 421 419 }; 422 420 module_platform_driver(stmpe_keypad_driver); 423 421
+2 -5
drivers/input/keyboard/tegra-kbc.c
··· 14 14 #include <linux/io.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/of.h> 17 - #include <linux/of_device.h> 17 + #include <linux/property.h> 18 18 #include <linux/clk.h> 19 19 #include <linux/slab.h> 20 20 #include <linux/input/matrix_keypad.h> ··· 602 602 unsigned int debounce_cnt; 603 603 unsigned int scan_time_rows; 604 604 unsigned int keymap_rows; 605 - const struct of_device_id *match; 606 - 607 - match = of_match_device(tegra_kbc_of_match, &pdev->dev); 608 605 609 606 kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL); 610 607 if (!kbc) { ··· 610 613 } 611 614 612 615 kbc->dev = &pdev->dev; 613 - kbc->hw_support = match->data; 616 + kbc->hw_support = device_get_match_data(&pdev->dev); 614 617 kbc->max_keys = kbc->hw_support->max_rows * 615 618 kbc->hw_support->max_columns; 616 619 kbc->num_rows_and_columns = kbc->hw_support->max_rows +
+2 -3
drivers/input/misc/88pm80x_onkey.c
··· 138 138 return err; 139 139 } 140 140 141 - static int pm80x_onkey_remove(struct platform_device *pdev) 141 + static void pm80x_onkey_remove(struct platform_device *pdev) 142 142 { 143 143 struct pm80x_onkey_info *info = platform_get_drvdata(pdev); 144 144 145 145 pm80x_free_irq(info->pm80x, info->irq, info); 146 146 input_unregister_device(info->idev); 147 147 kfree(info); 148 - return 0; 149 148 } 150 149 151 150 static struct platform_driver pm80x_onkey_driver = { ··· 153 154 .pm = &pm80x_onkey_pm_ops, 154 155 }, 155 156 .probe = pm80x_onkey_probe, 156 - .remove = pm80x_onkey_remove, 157 + .remove_new = pm80x_onkey_remove, 157 158 }; 158 159 159 160 module_platform_driver(pm80x_onkey_driver);
+1 -10
drivers/input/misc/axp20x-pek.c
··· 133 133 size_t count) 134 134 { 135 135 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); 136 - char val_str[20]; 137 - size_t len; 138 136 int ret, i; 139 137 unsigned int val, idx = 0; 140 138 unsigned int best_err = UINT_MAX; 141 139 142 - val_str[sizeof(val_str) - 1] = '\0'; 143 - strncpy(val_str, buf, sizeof(val_str) - 1); 144 - len = strlen(val_str); 145 - 146 - if (len && val_str[len - 1] == '\n') 147 - val_str[len - 1] = '\0'; 148 - 149 - ret = kstrtouint(val_str, 10, &val); 140 + ret = kstrtouint(buf, 10, &val); 150 141 if (ret) 151 142 return ret; 152 143
+2 -4
drivers/input/misc/da9052_onkey.c
··· 127 127 return error; 128 128 } 129 129 130 - static int da9052_onkey_remove(struct platform_device *pdev) 130 + static void da9052_onkey_remove(struct platform_device *pdev) 131 131 { 132 132 struct da9052_onkey *onkey = platform_get_drvdata(pdev); 133 133 ··· 136 136 137 137 input_unregister_device(onkey->input); 138 138 kfree(onkey); 139 - 140 - return 0; 141 139 } 142 140 143 141 static struct platform_driver da9052_onkey_driver = { 144 142 .probe = da9052_onkey_probe, 145 - .remove = da9052_onkey_remove, 143 + .remove_new = da9052_onkey_remove, 146 144 .driver = { 147 145 .name = "da9052-onkey", 148 146 },
+2 -4
drivers/input/misc/da9055_onkey.c
··· 132 132 return err; 133 133 } 134 134 135 - static int da9055_onkey_remove(struct platform_device *pdev) 135 + static void da9055_onkey_remove(struct platform_device *pdev) 136 136 { 137 137 struct da9055_onkey *onkey = platform_get_drvdata(pdev); 138 138 int irq = platform_get_irq_byname(pdev, "ONKEY"); ··· 141 141 free_irq(irq, onkey); 142 142 cancel_delayed_work_sync(&onkey->work); 143 143 input_unregister_device(onkey->input); 144 - 145 - return 0; 146 144 } 147 145 148 146 static struct platform_driver da9055_onkey_driver = { 149 147 .probe = da9055_onkey_probe, 150 - .remove = da9055_onkey_remove, 148 + .remove_new = da9055_onkey_remove, 151 149 .driver = { 152 150 .name = "da9055-onkey", 153 151 },
+2 -4
drivers/input/misc/ideapad_slidebar.c
··· 256 256 return err; 257 257 } 258 258 259 - static int ideapad_remove(struct platform_device *pdev) 259 + static void ideapad_remove(struct platform_device *pdev) 260 260 { 261 261 i8042_remove_filter(slidebar_i8042_filter); 262 262 input_unregister_device(slidebar_input_dev); 263 263 release_region(IDEAPAD_BASE, 3); 264 - 265 - return 0; 266 264 } 267 265 268 266 static struct platform_driver slidebar_drv = { 269 267 .driver = { 270 268 .name = "ideapad_slidebar", 271 269 }, 272 - .remove = ideapad_remove, 270 + .remove_new = ideapad_remove, 273 271 }; 274 272 275 273 static int __init ideapad_dmi_check(const struct dmi_system_id *id)
+2 -8
drivers/input/misc/iqs269a.c
··· 1586 1586 &dev_attr_ati_trigger.attr, 1587 1587 NULL, 1588 1588 }; 1589 - 1590 - static const struct attribute_group iqs269_attr_group = { 1591 - .attrs = iqs269_attrs, 1592 - }; 1589 + ATTRIBUTE_GROUPS(iqs269); 1593 1590 1594 1591 static const struct regmap_config iqs269_regmap_config = { 1595 1592 .reg_bits = 8, ··· 1668 1671 return error; 1669 1672 } 1670 1673 1671 - error = devm_device_add_group(&client->dev, &iqs269_attr_group); 1672 - if (error) 1673 - dev_err(&client->dev, "Failed to add attributes: %d\n", error); 1674 - 1675 1674 return error; 1676 1675 } 1677 1676 ··· 1736 1743 static struct i2c_driver iqs269_i2c_driver = { 1737 1744 .driver = { 1738 1745 .name = "iqs269a", 1746 + .dev_groups = iqs269_groups, 1739 1747 .of_match_table = iqs269_of_match, 1740 1748 .pm = pm_sleep_ptr(&iqs269_pm), 1741 1749 },
+17 -12
drivers/input/misc/kxtj9.c
··· 334 334 335 335 static DEVICE_ATTR(poll, S_IRUGO|S_IWUSR, kxtj9_get_poll, kxtj9_set_poll); 336 336 337 - static struct attribute *kxtj9_attributes[] = { 337 + static struct attribute *kxtj9_attrs[] = { 338 338 &dev_attr_poll.attr, 339 339 NULL 340 340 }; 341 341 342 - static struct attribute_group kxtj9_attribute_group = { 343 - .attrs = kxtj9_attributes 342 + static umode_t kxtj9_attr_is_visible(struct kobject *kobj, 343 + struct attribute *attr, int n) 344 + { 345 + struct device *dev = kobj_to_dev(kobj); 346 + struct i2c_client *client = to_i2c_client(dev); 347 + 348 + return client->irq ? attr->mode : 0; 349 + } 350 + 351 + static struct attribute_group kxtj9_group = { 352 + .attrs = kxtj9_attrs, 353 + .is_visible = kxtj9_attr_is_visible, 344 354 }; 355 + __ATTRIBUTE_GROUPS(kxtj9); 345 356 346 357 static void kxtj9_poll(struct input_dev *input) 347 358 { ··· 493 482 dev_err(&client->dev, "request irq failed: %d\n", err); 494 483 return err; 495 484 } 496 - 497 - err = devm_device_add_group(&client->dev, 498 - &kxtj9_attribute_group); 499 - if (err) { 500 - dev_err(&client->dev, "sysfs create failed: %d\n", err); 501 - return err; 502 - } 503 485 } 504 486 505 487 return 0; ··· 539 535 540 536 static struct i2c_driver kxtj9_driver = { 541 537 .driver = { 542 - .name = NAME, 543 - .pm = pm_sleep_ptr(&kxtj9_pm_ops), 538 + .name = NAME, 539 + .dev_groups = kxtj9_groups, 540 + .pm = pm_sleep_ptr(&kxtj9_pm_ops), 544 541 }, 545 542 .probe = kxtj9_probe, 546 543 .id_table = kxtj9_id,
+2 -4
drivers/input/misc/m68kspkr.c
··· 75 75 return 0; 76 76 } 77 77 78 - static int m68kspkr_remove(struct platform_device *dev) 78 + static void m68kspkr_remove(struct platform_device *dev) 79 79 { 80 80 struct input_dev *input_dev = platform_get_drvdata(dev); 81 81 82 82 input_unregister_device(input_dev); 83 83 /* turn off the speaker */ 84 84 m68kspkr_event(NULL, EV_SND, SND_BELL, 0); 85 - 86 - return 0; 87 85 } 88 86 89 87 static void m68kspkr_shutdown(struct platform_device *dev) ··· 95 97 .name = "m68kspkr", 96 98 }, 97 99 .probe = m68kspkr_probe, 98 - .remove = m68kspkr_remove, 100 + .remove_new = m68kspkr_remove, 99 101 .shutdown = m68kspkr_shutdown, 100 102 }; 101 103
+2 -4
drivers/input/misc/max8997_haptic.c
··· 351 351 return error; 352 352 } 353 353 354 - static int max8997_haptic_remove(struct platform_device *pdev) 354 + static void max8997_haptic_remove(struct platform_device *pdev) 355 355 { 356 356 struct max8997_haptic *chip = platform_get_drvdata(pdev); 357 357 ··· 362 362 pwm_put(chip->pwm); 363 363 364 364 kfree(chip); 365 - 366 - return 0; 367 365 } 368 366 369 367 static int max8997_haptic_suspend(struct device *dev) ··· 389 391 .pm = pm_sleep_ptr(&max8997_haptic_pm_ops), 390 392 }, 391 393 .probe = max8997_haptic_probe, 392 - .remove = max8997_haptic_remove, 394 + .remove_new = max8997_haptic_remove, 393 395 .id_table = max8997_haptic_id, 394 396 }; 395 397 module_platform_driver(max8997_haptic_driver);
+2 -4
drivers/input/misc/mc13783-pwrbutton.c
··· 229 229 return err; 230 230 } 231 231 232 - static int mc13783_pwrbutton_remove(struct platform_device *pdev) 232 + static void mc13783_pwrbutton_remove(struct platform_device *pdev) 233 233 { 234 234 struct mc13783_pwrb *priv = platform_get_drvdata(pdev); 235 235 const struct mc13xxx_buttons_platform_data *pdata; ··· 249 249 250 250 input_unregister_device(priv->pwr); 251 251 kfree(priv); 252 - 253 - return 0; 254 252 } 255 253 256 254 static struct platform_driver mc13783_pwrbutton_driver = { 257 255 .probe = mc13783_pwrbutton_probe, 258 - .remove = mc13783_pwrbutton_remove, 256 + .remove_new = mc13783_pwrbutton_remove, 259 257 .driver = { 260 258 .name = "mc13783-pwrbutton", 261 259 },
+2 -4
drivers/input/misc/palmas-pwrbutton.c
··· 245 245 * 246 246 * Return: 0 247 247 */ 248 - static int palmas_pwron_remove(struct platform_device *pdev) 248 + static void palmas_pwron_remove(struct platform_device *pdev) 249 249 { 250 250 struct palmas_pwron *pwron = platform_get_drvdata(pdev); 251 251 ··· 254 254 255 255 input_unregister_device(pwron->input_dev); 256 256 kfree(pwron); 257 - 258 - return 0; 259 257 } 260 258 261 259 /** ··· 310 312 311 313 static struct platform_driver palmas_pwron_driver = { 312 314 .probe = palmas_pwron_probe, 313 - .remove = palmas_pwron_remove, 315 + .remove_new = palmas_pwron_remove, 314 316 .driver = { 315 317 .name = "palmas_pwrbutton", 316 318 .of_match_table = of_match_ptr(of_palmas_pwr_match),
+2 -4
drivers/input/misc/pcap_keys.c
··· 99 99 return err; 100 100 } 101 101 102 - static int pcap_keys_remove(struct platform_device *pdev) 102 + static void pcap_keys_remove(struct platform_device *pdev) 103 103 { 104 104 struct pcap_keys *pcap_keys = platform_get_drvdata(pdev); 105 105 ··· 108 108 109 109 input_unregister_device(pcap_keys->input); 110 110 kfree(pcap_keys); 111 - 112 - return 0; 113 111 } 114 112 115 113 static struct platform_driver pcap_keys_device_driver = { 116 114 .probe = pcap_keys_probe, 117 - .remove = pcap_keys_remove, 115 + .remove_new = pcap_keys_remove, 118 116 .driver = { 119 117 .name = "pcap-keys", 120 118 }
+2 -4
drivers/input/misc/pcf50633-input.c
··· 87 87 return 0; 88 88 } 89 89 90 - static int pcf50633_input_remove(struct platform_device *pdev) 90 + static void pcf50633_input_remove(struct platform_device *pdev) 91 91 { 92 92 struct pcf50633_input *input = platform_get_drvdata(pdev); 93 93 ··· 96 96 97 97 input_unregister_device(input->input_dev); 98 98 kfree(input); 99 - 100 - return 0; 101 99 } 102 100 103 101 static struct platform_driver pcf50633_input_driver = { ··· 103 105 .name = "pcf50633-input", 104 106 }, 105 107 .probe = pcf50633_input_probe, 106 - .remove = pcf50633_input_remove, 108 + .remove_new = pcf50633_input_remove, 107 109 }; 108 110 module_platform_driver(pcf50633_input_driver); 109 111
+2 -4
drivers/input/misc/pcspkr.c
··· 95 95 return 0; 96 96 } 97 97 98 - static int pcspkr_remove(struct platform_device *dev) 98 + static void pcspkr_remove(struct platform_device *dev) 99 99 { 100 100 struct input_dev *pcspkr_dev = platform_get_drvdata(dev); 101 101 102 102 input_unregister_device(pcspkr_dev); 103 103 /* turn off the speaker */ 104 104 pcspkr_event(NULL, EV_SND, SND_BELL, 0); 105 - 106 - return 0; 107 105 } 108 106 109 107 static int pcspkr_suspend(struct device *dev) ··· 127 129 .pm = &pcspkr_pm_ops, 128 130 }, 129 131 .probe = pcspkr_probe, 130 - .remove = pcspkr_remove, 132 + .remove_new = pcspkr_remove, 131 133 .shutdown = pcspkr_shutdown, 132 134 }; 133 135 module_platform_driver(pcspkr_platform_driver);
+2 -4
drivers/input/misc/pm8941-pwrkey.c
··· 408 408 return 0; 409 409 } 410 410 411 - static int pm8941_pwrkey_remove(struct platform_device *pdev) 411 + static void pm8941_pwrkey_remove(struct platform_device *pdev) 412 412 { 413 413 struct pm8941_pwrkey *pwrkey = platform_get_drvdata(pdev); 414 414 415 415 if (pwrkey->data->supports_ps_hold_poff_config) 416 416 unregister_reboot_notifier(&pwrkey->reboot_notifier); 417 - 418 - return 0; 419 417 } 420 418 421 419 static const struct pm8941_data pwrkey_data = { ··· 465 467 466 468 static struct platform_driver pm8941_pwrkey_driver = { 467 469 .probe = pm8941_pwrkey_probe, 468 - .remove = pm8941_pwrkey_remove, 470 + .remove_new = pm8941_pwrkey_remove, 469 471 .driver = { 470 472 .name = "pm8941-pwrkey", 471 473 .pm = pm_sleep_ptr(&pm8941_pwr_key_pm_ops),
+2 -4
drivers/input/misc/soc_button_array.c
··· 411 411 return button_info; 412 412 } 413 413 414 - static int soc_button_remove(struct platform_device *pdev) 414 + static void soc_button_remove(struct platform_device *pdev) 415 415 { 416 416 struct soc_button_data *priv = platform_get_drvdata(pdev); 417 417 ··· 420 420 for (i = 0; i < BUTTON_TYPES; i++) 421 421 if (priv->children[i]) 422 422 platform_device_unregister(priv->children[i]); 423 - 424 - return 0; 425 423 } 426 424 427 425 static int soc_button_probe(struct platform_device *pdev) ··· 607 609 608 610 static struct platform_driver soc_button_driver = { 609 611 .probe = soc_button_probe, 610 - .remove = soc_button_remove, 612 + .remove_new = soc_button_remove, 611 613 .driver = { 612 614 .name = KBUILD_MODNAME, 613 615 .acpi_match_table = ACPI_PTR(soc_button_acpi_match),
+4 -8
drivers/input/misc/sparcspkr.c
··· 231 231 return err; 232 232 } 233 233 234 - static int bbc_remove(struct platform_device *op) 234 + static void bbc_remove(struct platform_device *op) 235 235 { 236 236 struct sparcspkr_state *state = platform_get_drvdata(op); 237 237 struct input_dev *input_dev = state->input_dev; ··· 245 245 of_iounmap(&op->resource[0], info->regs, 6); 246 246 247 247 kfree(state); 248 - 249 - return 0; 250 248 } 251 249 252 250 static const struct of_device_id bbc_beep_match[] = { ··· 262 264 .of_match_table = bbc_beep_match, 263 265 }, 264 266 .probe = bbc_beep_probe, 265 - .remove = bbc_remove, 267 + .remove_new = bbc_remove, 266 268 .shutdown = sparcspkr_shutdown, 267 269 }; 268 270 ··· 308 310 return err; 309 311 } 310 312 311 - static int grover_remove(struct platform_device *op) 313 + static void grover_remove(struct platform_device *op) 312 314 { 313 315 struct sparcspkr_state *state = platform_get_drvdata(op); 314 316 struct grover_beep_info *info = &state->u.grover; ··· 323 325 of_iounmap(&op->resource[2], info->freq_regs, 2); 324 326 325 327 kfree(state); 326 - 327 - return 0; 328 328 } 329 329 330 330 static const struct of_device_id grover_beep_match[] = { ··· 340 344 .of_match_table = grover_beep_match, 341 345 }, 342 346 .probe = grover_beep_probe, 343 - .remove = grover_remove, 347 + .remove_new = grover_remove, 344 348 .shutdown = sparcspkr_shutdown, 345 349 }; 346 350
+2 -4
drivers/input/misc/wistron_btns.c
··· 1286 1286 return 0; 1287 1287 } 1288 1288 1289 - static int wistron_remove(struct platform_device *dev) 1289 + static void wistron_remove(struct platform_device *dev) 1290 1290 { 1291 1291 wistron_led_remove(); 1292 1292 input_unregister_device(wistron_idev); 1293 1293 bios_detach(); 1294 - 1295 - return 0; 1296 1294 } 1297 1295 1298 1296 static int wistron_suspend(struct device *dev) ··· 1334 1336 .pm = pm_sleep_ptr(&wistron_pm_ops), 1335 1337 }, 1336 1338 .probe = wistron_probe, 1337 - .remove = wistron_remove, 1339 + .remove_new = wistron_remove, 1338 1340 }; 1339 1341 1340 1342 static int __init wb_module_init(void)
+2 -4
drivers/input/misc/wm831x-on.c
··· 123 123 return ret; 124 124 } 125 125 126 - static int wm831x_on_remove(struct platform_device *pdev) 126 + static void wm831x_on_remove(struct platform_device *pdev) 127 127 { 128 128 struct wm831x_on *wm831x_on = platform_get_drvdata(pdev); 129 129 int irq = platform_get_irq(pdev, 0); 130 130 131 131 free_irq(irq, wm831x_on); 132 132 cancel_delayed_work_sync(&wm831x_on->work); 133 - 134 - return 0; 135 133 } 136 134 137 135 static struct platform_driver wm831x_on_driver = { 138 136 .probe = wm831x_on_probe, 139 - .remove = wm831x_on_remove, 137 + .remove_new = wm831x_on_remove, 140 138 .driver = { 141 139 .name = "wm831x-on", 142 140 },
+3 -11
drivers/input/mouse/cyapa.c
··· 1223 1223 static DEVICE_ATTR(calibrate, S_IWUSR, NULL, cyapa_calibrate_store); 1224 1224 static DEVICE_ATTR(mode, S_IRUGO, cyapa_show_mode, NULL); 1225 1225 1226 - static struct attribute *cyapa_sysfs_entries[] = { 1226 + static struct attribute *cyapa_attrs[] = { 1227 1227 &dev_attr_firmware_version.attr, 1228 1228 &dev_attr_product_id.attr, 1229 1229 &dev_attr_update_fw.attr, ··· 1232 1232 &dev_attr_mode.attr, 1233 1233 NULL, 1234 1234 }; 1235 - 1236 - static const struct attribute_group cyapa_sysfs_group = { 1237 - .attrs = cyapa_sysfs_entries, 1238 - }; 1235 + ATTRIBUTE_GROUPS(cyapa); 1239 1236 1240 1237 static void cyapa_disable_regulator(void *data) 1241 1238 { ··· 1296 1299 error = cyapa_initialize(cyapa); 1297 1300 if (error) { 1298 1301 dev_err(dev, "failed to detect and initialize tp device.\n"); 1299 - return error; 1300 - } 1301 - 1302 - error = devm_device_add_group(dev, &cyapa_sysfs_group); 1303 - if (error) { 1304 - dev_err(dev, "failed to create sysfs entries: %d\n", error); 1305 1302 return error; 1306 1303 } 1307 1304 ··· 1475 1484 static struct i2c_driver cyapa_driver = { 1476 1485 .driver = { 1477 1486 .name = "cyapa", 1487 + .dev_groups = cyapa_groups, 1478 1488 .pm = pm_ptr(&cyapa_pm_ops), 1479 1489 .acpi_match_table = ACPI_PTR(cyapa_acpi_id), 1480 1490 .of_match_table = of_match_ptr(cyapa_of_match),
+2 -4
drivers/input/mouse/navpoint.c
··· 295 295 return error; 296 296 } 297 297 298 - static int navpoint_remove(struct platform_device *pdev) 298 + static void navpoint_remove(struct platform_device *pdev) 299 299 { 300 300 const struct navpoint_platform_data *pdata = 301 301 dev_get_platdata(&pdev->dev); ··· 311 311 312 312 if (gpio_is_valid(pdata->gpio)) 313 313 gpio_free(pdata->gpio); 314 - 315 - return 0; 316 314 } 317 315 318 316 static int navpoint_suspend(struct device *dev) ··· 346 348 347 349 static struct platform_driver navpoint_driver = { 348 350 .probe = navpoint_probe, 349 - .remove = navpoint_remove, 351 + .remove_new = navpoint_remove, 350 352 .driver = { 351 353 .name = "navpoint", 352 354 .pm = pm_sleep_ptr(&navpoint_pm_ops),
+1 -1
drivers/input/rmi4/rmi_bus.c
··· 277 277 278 278 device_del(&fn->dev); 279 279 of_node_put(fn->dev.of_node); 280 - put_device(&fn->dev); 281 280 282 281 for (i = 0; i < fn->num_of_irqs; i++) 283 282 irq_dispose_mapping(fn->irq[i]); 284 283 284 + put_device(&fn->dev); 285 285 } 286 286 287 287 /**
+1 -1
drivers/input/rmi4/rmi_f34.c
··· 471 471 if (buf[count - 1] == '\0' || buf[count - 1] == '\n') 472 472 copy_count -= 1; 473 473 474 - strncpy(fw_name, buf, copy_count); 474 + memcpy(fw_name, buf, copy_count); 475 475 fw_name[copy_count] = '\0'; 476 476 477 477 ret = request_firmware(&fw, fw_name, dev);
+2 -4
drivers/input/serio/altera_ps2.c
··· 125 125 /* 126 126 * Remove one device from this driver. 127 127 */ 128 - static int altera_ps2_remove(struct platform_device *pdev) 128 + static void altera_ps2_remove(struct platform_device *pdev) 129 129 { 130 130 struct ps2if *ps2if = platform_get_drvdata(pdev); 131 131 132 132 serio_unregister_port(ps2if->io); 133 - 134 - return 0; 135 133 } 136 134 137 135 #ifdef CONFIG_OF ··· 146 148 */ 147 149 static struct platform_driver altera_ps2_driver = { 148 150 .probe = altera_ps2_probe, 149 - .remove = altera_ps2_remove, 151 + .remove_new = altera_ps2_remove, 150 152 .driver = { 151 153 .name = DRV_NAME, 152 154 .of_match_table = of_match_ptr(altera_ps2_match),
+2 -4
drivers/input/serio/ams_delta_serio.c
··· 173 173 return 0; 174 174 } 175 175 176 - static int ams_delta_serio_exit(struct platform_device *pdev) 176 + static void ams_delta_serio_exit(struct platform_device *pdev) 177 177 { 178 178 struct ams_delta_serio *priv = platform_get_drvdata(pdev); 179 179 180 180 serio_unregister_port(priv->serio); 181 - 182 - return 0; 183 181 } 184 182 185 183 static struct platform_driver ams_delta_serio_driver = { 186 184 .probe = ams_delta_serio_init, 187 - .remove = ams_delta_serio_exit, 185 + .remove_new = ams_delta_serio_exit, 188 186 .driver = { 189 187 .name = DRIVER_NAME 190 188 },
+2 -4
drivers/input/serio/apbps2.c
··· 187 187 return 0; 188 188 } 189 189 190 - static int apbps2_of_remove(struct platform_device *of_dev) 190 + static void apbps2_of_remove(struct platform_device *of_dev) 191 191 { 192 192 struct apbps2_priv *priv = platform_get_drvdata(of_dev); 193 193 194 194 serio_unregister_port(priv->io); 195 - 196 - return 0; 197 195 } 198 196 199 197 static const struct of_device_id apbps2_of_match[] = { ··· 208 210 .of_match_table = apbps2_of_match, 209 211 }, 210 212 .probe = apbps2_of_probe, 211 - .remove = apbps2_of_remove, 213 + .remove_new = apbps2_of_remove, 212 214 }; 213 215 214 216 module_platform_driver(apbps2_of_driver);
+2 -4
drivers/input/serio/arc_ps2.c
··· 232 232 return 0; 233 233 } 234 234 235 - static int arc_ps2_remove(struct platform_device *pdev) 235 + static void arc_ps2_remove(struct platform_device *pdev) 236 236 { 237 237 struct arc_ps2_data *arc_ps2 = platform_get_drvdata(pdev); 238 238 int i; ··· 244 244 dev_dbg(&pdev->dev, "frame error count = %i\n", arc_ps2->frame_error); 245 245 dev_dbg(&pdev->dev, "buffer overflow count = %i\n", 246 246 arc_ps2->buf_overflow); 247 - 248 - return 0; 249 247 } 250 248 251 249 #ifdef CONFIG_OF ··· 260 262 .of_match_table = of_match_ptr(arc_ps2_match), 261 263 }, 262 264 .probe = arc_ps2_probe, 263 - .remove = arc_ps2_remove, 265 + .remove_new = arc_ps2_remove, 264 266 }; 265 267 266 268 module_platform_driver(arc_ps2_driver);
+2 -4
drivers/input/serio/ct82c710.c
··· 180 180 return 0; 181 181 } 182 182 183 - static int ct82c710_remove(struct platform_device *dev) 183 + static void ct82c710_remove(struct platform_device *dev) 184 184 { 185 185 serio_unregister_port(ct82c710_port); 186 - 187 - return 0; 188 186 } 189 187 190 188 static struct platform_driver ct82c710_driver = { ··· 190 192 .name = "ct82c710", 191 193 }, 192 194 .probe = ct82c710_probe, 193 - .remove = ct82c710_remove, 195 + .remove_new = ct82c710_remove, 194 196 }; 195 197 196 198
+2 -4
drivers/input/serio/i8042-sparcio.h
··· 82 82 return 0; 83 83 } 84 84 85 - static int sparc_i8042_remove(struct platform_device *op) 85 + static void sparc_i8042_remove(struct platform_device *op) 86 86 { 87 87 of_iounmap(kbd_res, kbd_iobase, 8); 88 - 89 - return 0; 90 88 } 91 89 92 90 static const struct of_device_id sparc_i8042_match[] = { ··· 101 103 .of_match_table = sparc_i8042_match, 102 104 }, 103 105 .probe = sparc_i8042_probe, 104 - .remove = sparc_i8042_remove, 106 + .remove_new = sparc_i8042_remove, 105 107 }; 106 108 107 109 static bool i8042_is_mr_coffee(void)
+2 -4
drivers/input/serio/i8042.c
··· 1584 1584 return error; 1585 1585 } 1586 1586 1587 - static int i8042_remove(struct platform_device *dev) 1587 + static void i8042_remove(struct platform_device *dev) 1588 1588 { 1589 1589 i8042_unregister_ports(); 1590 1590 i8042_free_irqs(); 1591 1591 i8042_controller_reset(false); 1592 - 1593 - return 0; 1594 1592 } 1595 1593 1596 1594 static struct platform_driver i8042_driver = { ··· 1599 1601 #endif 1600 1602 }, 1601 1603 .probe = i8042_probe, 1602 - .remove = i8042_remove, 1604 + .remove_new = i8042_remove, 1603 1605 .shutdown = i8042_shutdown, 1604 1606 }; 1605 1607
+2 -4
drivers/input/serio/ioc3kbd.c
··· 190 190 return 0; 191 191 } 192 192 193 - static int ioc3kbd_remove(struct platform_device *pdev) 193 + static void ioc3kbd_remove(struct platform_device *pdev) 194 194 { 195 195 struct ioc3kbd_data *d = platform_get_drvdata(pdev); 196 196 ··· 198 198 199 199 serio_unregister_port(d->kbd); 200 200 serio_unregister_port(d->aux); 201 - 202 - return 0; 203 201 } 204 202 205 203 static struct platform_driver ioc3kbd_driver = { 206 204 .probe = ioc3kbd_probe, 207 - .remove = ioc3kbd_remove, 205 + .remove_new = ioc3kbd_remove, 208 206 .driver = { 209 207 .name = "ioc3-kbd", 210 208 },
+2 -4
drivers/input/serio/maceps2.c
··· 148 148 return 0; 149 149 } 150 150 151 - static int maceps2_remove(struct platform_device *dev) 151 + static void maceps2_remove(struct platform_device *dev) 152 152 { 153 153 serio_unregister_port(maceps2_port[0]); 154 154 serio_unregister_port(maceps2_port[1]); 155 - 156 - return 0; 157 155 } 158 156 159 157 static struct platform_driver maceps2_driver = { ··· 159 161 .name = "maceps2", 160 162 }, 161 163 .probe = maceps2_probe, 162 - .remove = maceps2_remove, 164 + .remove_new = maceps2_remove, 163 165 }; 164 166 165 167 static int __init maceps2_init(void)
+2 -4
drivers/input/serio/olpc_apsp.c
··· 238 238 return error; 239 239 } 240 240 241 - static int olpc_apsp_remove(struct platform_device *pdev) 241 + static void olpc_apsp_remove(struct platform_device *pdev) 242 242 { 243 243 struct olpc_apsp *priv = platform_get_drvdata(pdev); 244 244 ··· 246 246 247 247 serio_unregister_port(priv->kbio); 248 248 serio_unregister_port(priv->padio); 249 - 250 - return 0; 251 249 } 252 250 253 251 static const struct of_device_id olpc_apsp_dt_ids[] = { ··· 256 258 257 259 static struct platform_driver olpc_apsp_driver = { 258 260 .probe = olpc_apsp_probe, 259 - .remove = olpc_apsp_remove, 261 + .remove_new = olpc_apsp_remove, 260 262 .driver = { 261 263 .name = "olpc-apsp", 262 264 .of_match_table = olpc_apsp_dt_ids,
+2 -3
drivers/input/serio/ps2-gpio.c
··· 476 476 return error; 477 477 } 478 478 479 - static int ps2_gpio_remove(struct platform_device *pdev) 479 + static void ps2_gpio_remove(struct platform_device *pdev) 480 480 { 481 481 struct ps2_gpio_data *drvdata = platform_get_drvdata(pdev); 482 482 483 483 serio_unregister_port(drvdata->serio); 484 - return 0; 485 484 } 486 485 487 486 #if defined(CONFIG_OF) ··· 493 494 494 495 static struct platform_driver ps2_gpio_driver = { 495 496 .probe = ps2_gpio_probe, 496 - .remove = ps2_gpio_remove, 497 + .remove_new = ps2_gpio_remove, 497 498 .driver = { 498 499 .name = DRIVER_NAME, 499 500 .of_match_table = of_match_ptr(ps2_gpio_match),
+2 -4
drivers/input/serio/q40kbd.c
··· 148 148 return error; 149 149 } 150 150 151 - static int q40kbd_remove(struct platform_device *pdev) 151 + static void q40kbd_remove(struct platform_device *pdev) 152 152 { 153 153 struct q40kbd *q40kbd = platform_get_drvdata(pdev); 154 154 ··· 160 160 serio_unregister_port(q40kbd->port); 161 161 free_irq(Q40_IRQ_KEYBOARD, q40kbd); 162 162 kfree(q40kbd); 163 - 164 - return 0; 165 163 } 166 164 167 165 static struct platform_driver q40kbd_driver = { 168 166 .driver = { 169 167 .name = "q40kbd", 170 168 }, 171 - .remove = q40kbd_remove, 169 + .remove_new = q40kbd_remove, 172 170 }; 173 171 174 172 module_platform_driver_probe(q40kbd_driver, q40kbd_probe);
+2 -4
drivers/input/serio/rpckbd.c
··· 133 133 return 0; 134 134 } 135 135 136 - static int rpckbd_remove(struct platform_device *dev) 136 + static void rpckbd_remove(struct platform_device *dev) 137 137 { 138 138 struct serio *serio = platform_get_drvdata(dev); 139 139 struct rpckbd_data *rpckbd = serio->port_data; 140 140 141 141 serio_unregister_port(serio); 142 142 kfree(rpckbd); 143 - 144 - return 0; 145 143 } 146 144 147 145 static struct platform_driver rpckbd_driver = { 148 146 .probe = rpckbd_probe, 149 - .remove = rpckbd_remove, 147 + .remove_new = rpckbd_remove, 150 148 .driver = { 151 149 .name = "kart", 152 150 },
+2 -4
drivers/input/serio/sun4i-ps2.c
··· 297 297 return error; 298 298 } 299 299 300 - static int sun4i_ps2_remove(struct platform_device *pdev) 300 + static void sun4i_ps2_remove(struct platform_device *pdev) 301 301 { 302 302 struct sun4i_ps2data *drvdata = platform_get_drvdata(pdev); 303 303 ··· 311 311 iounmap(drvdata->reg_base); 312 312 313 313 kfree(drvdata); 314 - 315 - return 0; 316 314 } 317 315 318 316 static const struct of_device_id sun4i_ps2_match[] = { ··· 322 324 323 325 static struct platform_driver sun4i_ps2_driver = { 324 326 .probe = sun4i_ps2_probe, 325 - .remove = sun4i_ps2_remove, 327 + .remove_new = sun4i_ps2_remove, 326 328 .driver = { 327 329 .name = DRIVER_NAME, 328 330 .of_match_table = sun4i_ps2_match,
+2 -4
drivers/input/serio/xilinx_ps2.c
··· 329 329 * if the driver module is being unloaded. It frees any resources allocated to 330 330 * the device. 331 331 */ 332 - static int xps2_of_remove(struct platform_device *of_dev) 332 + static void xps2_of_remove(struct platform_device *of_dev) 333 333 { 334 334 struct xps2data *drvdata = platform_get_drvdata(of_dev); 335 335 struct resource r_mem; /* IO mem resources */ ··· 344 344 release_mem_region(r_mem.start, resource_size(&r_mem)); 345 345 346 346 kfree(drvdata); 347 - 348 - return 0; 349 347 } 350 348 351 349 /* Match table for of_platform binding */ ··· 359 361 .of_match_table = xps2_of_match, 360 362 }, 361 363 .probe = xps2_of_probe, 362 - .remove = xps2_of_remove, 364 + .remove_new = xps2_of_remove, 363 365 }; 364 366 module_platform_driver(xps2_of_driver); 365 367
+5 -7
drivers/input/touchscreen/ad7877.c
··· 612 612 return mode; 613 613 } 614 614 615 - static const struct attribute_group ad7877_attr_group = { 615 + static const struct attribute_group ad7877_group = { 616 616 .is_visible = ad7877_attr_is_visible, 617 617 .attrs = ad7877_attributes, 618 618 }; 619 + __ATTRIBUTE_GROUPS(ad7877); 619 620 620 621 static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts) 621 622 { ··· 778 777 return err; 779 778 } 780 779 781 - err = devm_device_add_group(&spi->dev, &ad7877_attr_group); 782 - if (err) 783 - return err; 784 - 785 780 err = input_register_device(input_dev); 786 781 if (err) 787 782 return err; ··· 807 810 808 811 static struct spi_driver ad7877_driver = { 809 812 .driver = { 810 - .name = "ad7877", 811 - .pm = pm_sleep_ptr(&ad7877_pm), 813 + .name = "ad7877", 814 + .dev_groups = ad7877_groups, 815 + .pm = pm_sleep_ptr(&ad7877_pm), 812 816 }, 813 817 .probe = ad7877_probe, 814 818 };
+4 -3
drivers/input/touchscreen/ad7879-i2c.c
··· 58 58 59 59 static struct i2c_driver ad7879_i2c_driver = { 60 60 .driver = { 61 - .name = "ad7879", 62 - .pm = &ad7879_pm_ops, 63 - .of_match_table = of_match_ptr(ad7879_i2c_dt_ids), 61 + .name = "ad7879", 62 + .dev_groups = ad7879_groups, 63 + .pm = &ad7879_pm_ops, 64 + .of_match_table = of_match_ptr(ad7879_i2c_dt_ids), 64 65 }, 65 66 .probe = ad7879_i2c_probe, 66 67 .id_table = ad7879_id,
+4 -3
drivers/input/touchscreen/ad7879-spi.c
··· 56 56 57 57 static struct spi_driver ad7879_spi_driver = { 58 58 .driver = { 59 - .name = "ad7879", 60 - .pm = &ad7879_pm_ops, 61 - .of_match_table = of_match_ptr(ad7879_spi_dt_ids), 59 + .name = "ad7879", 60 + .dev_groups = ad7879_groups, 61 + .pm = &ad7879_pm_ops, 62 + .of_match_table = of_match_ptr(ad7879_spi_dt_ids), 62 63 }, 63 64 .probe = ad7879_spi_probe, 64 65 };
+6 -4
drivers/input/touchscreen/ad7879.c
··· 391 391 .attrs = ad7879_attributes, 392 392 }; 393 393 394 + const struct attribute_group *ad7879_groups[] = { 395 + &ad7879_attr_group, 396 + NULL 397 + }; 398 + EXPORT_SYMBOL_GPL(ad7879_groups); 399 + 394 400 #ifdef CONFIG_GPIOLIB 395 401 static int ad7879_gpio_direction_input(struct gpio_chip *chip, 396 402 unsigned gpio) ··· 617 611 } 618 612 619 613 __ad7879_disable(ts); 620 - 621 - err = devm_device_add_group(dev, &ad7879_attr_group); 622 - if (err) 623 - return err; 624 614 625 615 err = ad7879_gpio_add(ts); 626 616 if (err)
+3
drivers/input/touchscreen/ad7879.h
··· 8 8 #ifndef _AD7879_H_ 9 9 #define _AD7879_H_ 10 10 11 + #include <linux/pm.h> 11 12 #include <linux/types.h> 12 13 14 + struct attribute_group; 13 15 struct device; 14 16 struct regmap; 15 17 18 + extern const struct attribute_group *ad7879_groups[]; 16 19 extern const struct dev_pm_ops ad7879_pm_ops; 17 20 18 21 int ad7879_probe(struct device *dev, struct regmap *regmap,
+6 -12
drivers/input/touchscreen/ads7846.c
··· 625 625 626 626 static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store); 627 627 628 - static struct attribute *ads784x_attributes[] = { 628 + static struct attribute *ads784x_attrs[] = { 629 629 &dev_attr_pen_down.attr, 630 630 &dev_attr_disable.attr, 631 631 NULL, 632 632 }; 633 - 634 - static const struct attribute_group ads784x_attr_group = { 635 - .attrs = ads784x_attributes, 636 - }; 633 + ATTRIBUTE_GROUPS(ads784x); 637 634 638 635 /*--------------------------------------------------------------------------*/ 639 636 ··· 1354 1357 else 1355 1358 (void) ads7846_read12_ser(dev, READ_12BIT_SER(vaux)); 1356 1359 1357 - err = devm_device_add_group(dev, &ads784x_attr_group); 1358 - if (err) 1359 - return err; 1360 - 1361 1360 err = input_register_device(input_dev); 1362 1361 if (err) 1363 1362 return err; ··· 1379 1386 1380 1387 static struct spi_driver ads7846_driver = { 1381 1388 .driver = { 1382 - .name = "ads7846", 1383 - .pm = pm_sleep_ptr(&ads7846_pm), 1384 - .of_match_table = ads7846_dt_ids, 1389 + .name = "ads7846", 1390 + .dev_groups = ads784x_groups, 1391 + .pm = pm_sleep_ptr(&ads7846_pm), 1392 + .of_match_table = ads7846_dt_ids, 1385 1393 }, 1386 1394 .probe = ads7846_probe, 1387 1395 .remove = ads7846_remove,
+12 -7
drivers/input/touchscreen/cyttsp5.c
··· 207 207 int num_prv_rec; 208 208 struct regmap *regmap; 209 209 struct touchscreen_properties prop; 210 - struct regulator *vdd; 210 + struct regulator_bulk_data supplies[2]; 211 211 }; 212 212 213 213 /* ··· 817 817 { 818 818 struct cyttsp5 *ts = data; 819 819 820 - regulator_disable(ts->vdd); 820 + regulator_bulk_disable(ARRAY_SIZE(ts->supplies), ts->supplies); 821 821 } 822 822 823 823 static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq, ··· 840 840 init_completion(&ts->cmd_done); 841 841 842 842 /* Power up the device */ 843 - ts->vdd = devm_regulator_get(dev, "vdd"); 844 - if (IS_ERR(ts->vdd)) { 845 - error = PTR_ERR(ts->vdd); 843 + ts->supplies[0].supply = "vdd"; 844 + ts->supplies[1].supply = "vddio"; 845 + error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->supplies), 846 + ts->supplies); 847 + if (error) { 848 + dev_err(ts->dev, "Failed to get regulators, error %d\n", error); 846 849 return error; 847 850 } 848 851 ··· 853 850 if (error) 854 851 return error; 855 852 856 - error = regulator_enable(ts->vdd); 857 - if (error) 853 + error = regulator_bulk_enable(ARRAY_SIZE(ts->supplies), ts->supplies); 854 + if (error) { 855 + dev_err(ts->dev, "Failed to enable regulators, error %d\n", error); 858 856 return error; 857 + } 859 858 860 859 ts->input = devm_input_allocate_device(dev); 861 860 if (!ts->input) {
+2 -4
drivers/input/touchscreen/da9052_tsi.c
··· 311 311 return error; 312 312 } 313 313 314 - static int da9052_ts_remove(struct platform_device *pdev) 314 + static void da9052_ts_remove(struct platform_device *pdev) 315 315 { 316 316 struct da9052_tsi *tsi = platform_get_drvdata(pdev); 317 317 ··· 322 322 323 323 input_unregister_device(tsi->dev); 324 324 kfree(tsi); 325 - 326 - return 0; 327 325 } 328 326 329 327 static struct platform_driver da9052_tsi_driver = { 330 328 .probe = da9052_ts_probe, 331 - .remove = da9052_ts_remove, 329 + .remove_new = da9052_ts_remove, 332 330 .driver = { 333 331 .name = "da9052-tsi", 334 332 },
+2 -8
drivers/input/touchscreen/edt-ft5x06.c
··· 580 580 &dev_attr_crc_errors.attr, 581 581 NULL 582 582 }; 583 - 584 - static const struct attribute_group edt_ft5x06_attr_group = { 585 - .attrs = edt_ft5x06_attrs, 586 - }; 583 + ATTRIBUTE_GROUPS(edt_ft5x06); 587 584 588 585 static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata) 589 586 { ··· 1327 1330 return error; 1328 1331 } 1329 1332 1330 - error = devm_device_add_group(&client->dev, &edt_ft5x06_attr_group); 1331 - if (error) 1332 - return error; 1333 - 1334 1333 error = input_register_device(input); 1335 1334 if (error) 1336 1335 return error; ··· 1495 1502 static struct i2c_driver edt_ft5x06_ts_driver = { 1496 1503 .driver = { 1497 1504 .name = "edt_ft5x06", 1505 + .dev_groups = edt_ft5x06_groups, 1498 1506 .of_match_table = edt_ft5x06_of_match, 1499 1507 .pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops), 1500 1508 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+3 -12
drivers/input/touchscreen/elants_i2c.c
··· 1299 1299 static ELANTS_VERSION_ATTR(bc_version); 1300 1300 static ELANTS_VERSION_ATTR(iap_version); 1301 1301 1302 - static struct attribute *elants_attributes[] = { 1302 + static struct attribute *elants_i2c_attrs[] = { 1303 1303 &dev_attr_calibrate.attr, 1304 1304 &dev_attr_update_fw.attr, 1305 1305 &dev_attr_iap_mode.attr, ··· 1313 1313 &elants_ver_attr_iap_version.dattr.attr, 1314 1314 NULL 1315 1315 }; 1316 - 1317 - static const struct attribute_group elants_attribute_group = { 1318 - .attrs = elants_attributes, 1319 - }; 1316 + ATTRIBUTE_GROUPS(elants_i2c); 1320 1317 1321 1318 static int elants_i2c_power_on(struct elants_data *ts) 1322 1319 { ··· 1549 1552 return error; 1550 1553 } 1551 1554 1552 - error = devm_device_add_group(&client->dev, &elants_attribute_group); 1553 - if (error) { 1554 - dev_err(&client->dev, "failed to create sysfs attributes: %d\n", 1555 - error); 1556 - return error; 1557 - } 1558 - 1559 1555 return 0; 1560 1556 } 1561 1557 ··· 1657 1667 .id_table = elants_i2c_id, 1658 1668 .driver = { 1659 1669 .name = DEVICE_NAME, 1670 + .dev_groups = elants_i2c_groups, 1660 1671 .pm = pm_sleep_ptr(&elants_i2c_pm_ops), 1661 1672 .acpi_match_table = ACPI_PTR(elants_acpi_id), 1662 1673 .of_match_table = of_match_ptr(elants_of_match),
+3 -9
drivers/input/touchscreen/exc3000.c
··· 325 325 } 326 326 static DEVICE_ATTR_RO(type); 327 327 328 - static struct attribute *sysfs_attrs[] = { 328 + static struct attribute *exc3000_attrs[] = { 329 329 &dev_attr_fw_version.attr, 330 330 &dev_attr_model.attr, 331 331 &dev_attr_type.attr, 332 332 NULL 333 333 }; 334 - 335 - static struct attribute_group exc3000_attribute_group = { 336 - .attrs = sysfs_attrs 337 - }; 334 + ATTRIBUTE_GROUPS(exc3000); 338 335 339 336 static int exc3000_probe(struct i2c_client *client) 340 337 { ··· 434 437 435 438 i2c_set_clientdata(client, data); 436 439 437 - error = devm_device_add_group(&client->dev, &exc3000_attribute_group); 438 - if (error) 439 - return error; 440 - 441 440 return 0; 442 441 } 443 442 ··· 466 473 static struct i2c_driver exc3000_driver = { 467 474 .driver = { 468 475 .name = "exc3000", 476 + .dev_groups = exc3000_groups, 469 477 .of_match_table = of_match_ptr(exc3000_of_match), 470 478 .acpi_match_table = ACPI_PTR(exc3000_acpi_match), 471 479 },
+3 -12
drivers/input/touchscreen/hideep.c
··· 954 954 static DEVICE_ATTR(product_id, 0664, hideep_product_id_show, NULL); 955 955 static DEVICE_ATTR(update_fw, 0664, NULL, hideep_update_fw); 956 956 957 - static struct attribute *hideep_ts_sysfs_entries[] = { 957 + static struct attribute *hideep_ts_attrs[] = { 958 958 &dev_attr_version.attr, 959 959 &dev_attr_product_id.attr, 960 960 &dev_attr_update_fw.attr, 961 961 NULL, 962 962 }; 963 - 964 - static const struct attribute_group hideep_ts_attr_group = { 965 - .attrs = hideep_ts_sysfs_entries, 966 - }; 963 + ATTRIBUTE_GROUPS(hideep_ts); 967 964 968 965 static void hideep_set_work_mode(struct hideep_ts *ts) 969 966 { ··· 1093 1096 return error; 1094 1097 } 1095 1098 1096 - error = devm_device_add_group(&client->dev, &hideep_ts_attr_group); 1097 - if (error) { 1098 - dev_err(&client->dev, 1099 - "failed to add sysfs attributes: %d\n", error); 1100 - return error; 1101 - } 1102 - 1103 1099 return 0; 1104 1100 } 1105 1101 ··· 1121 1131 static struct i2c_driver hideep_driver = { 1122 1132 .driver = { 1123 1133 .name = HIDEEP_I2C_NAME, 1134 + .dev_groups = hideep_ts_groups, 1124 1135 .of_match_table = of_match_ptr(hideep_match_table), 1125 1136 .acpi_match_table = ACPI_PTR(hideep_acpi_id), 1126 1137 .pm = pm_sleep_ptr(&hideep_pm_ops),
+2 -8
drivers/input/touchscreen/hycon-hy46xx.c
··· 274 274 &hycon_hy46xx_attr_bootloader_version.dattr.attr, 275 275 NULL 276 276 }; 277 - 278 - static const struct attribute_group hycon_hy46xx_attr_group = { 279 - .attrs = hycon_hy46xx_attrs, 280 - }; 277 + ATTRIBUTE_GROUPS(hycon_hy46xx); 281 278 282 279 static void hycon_hy46xx_get_defaults(struct device *dev, struct hycon_hy46xx_data *tsdata) 283 280 { ··· 532 535 return error; 533 536 } 534 537 535 - error = devm_device_add_group(&client->dev, &hycon_hy46xx_attr_group); 536 - if (error) 537 - return error; 538 - 539 538 error = input_register_device(input); 540 539 if (error) 541 540 return error; ··· 569 576 static struct i2c_driver hycon_hy46xx_driver = { 570 577 .driver = { 571 578 .name = "hycon_hy46xx", 579 + .dev_groups = hycon_hy46xx_groups, 572 580 .of_match_table = hycon_hy46xx_of_match, 573 581 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 574 582 },
+5 -10
drivers/input/touchscreen/ili210x.c
··· 876 876 877 877 static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store); 878 878 879 - static struct attribute *ili210x_attributes[] = { 879 + static struct attribute *ili210x_attrs[] = { 880 880 &dev_attr_calibrate.attr, 881 881 &dev_attr_firmware_update.attr, 882 882 &dev_attr_firmware_version.attr, ··· 904 904 return attr->mode; 905 905 } 906 906 907 - static const struct attribute_group ili210x_attr_group = { 908 - .attrs = ili210x_attributes, 907 + static const struct attribute_group ili210x_group = { 908 + .attrs = ili210x_attrs, 909 909 .is_visible = ili210x_attributes_visible, 910 910 }; 911 + __ATTRIBUTE_GROUPS(ili210x); 911 912 912 913 static void ili210x_power_down(void *data) 913 914 { ··· 1014 1013 if (error) 1015 1014 return error; 1016 1015 1017 - error = devm_device_add_group(dev, &ili210x_attr_group); 1018 - if (error) { 1019 - dev_err(dev, "Unable to create sysfs attributes, err: %d\n", 1020 - error); 1021 - return error; 1022 - } 1023 - 1024 1016 error = input_register_device(priv->input); 1025 1017 if (error) { 1026 1018 dev_err(dev, "Cannot register input device, err: %d\n", error); ··· 1044 1050 static struct i2c_driver ili210x_ts_driver = { 1045 1051 .driver = { 1046 1052 .name = "ili210x_i2c", 1053 + .dev_groups = ili210x_groups, 1047 1054 .of_match_table = ili210x_dt_ids, 1048 1055 }, 1049 1056 .id_table = ili210x_i2c_id,
+2 -10
drivers/input/touchscreen/ilitek_ts_i2c.c
··· 537 537 &dev_attr_product_id.attr, 538 538 NULL 539 539 }; 540 - 541 - static struct attribute_group ilitek_attrs_group = { 542 - .attrs = ilitek_sysfs_attrs, 543 - }; 540 + ATTRIBUTE_GROUPS(ilitek_sysfs); 544 541 545 542 static int ilitek_ts_i2c_probe(struct i2c_client *client) 546 543 { ··· 589 592 "ilitek_touch_irq", ts); 590 593 if (error) { 591 594 dev_err(dev, "request threaded irq failed: %d\n", error); 592 - return error; 593 - } 594 - 595 - error = devm_device_add_group(dev, &ilitek_attrs_group); 596 - if (error) { 597 - dev_err(dev, "sysfs create group failed: %d\n", error); 598 595 return error; 599 596 } 600 597 ··· 666 675 static struct i2c_driver ilitek_ts_i2c_driver = { 667 676 .driver = { 668 677 .name = ILITEK_TS_NAME, 678 + .dev_groups = ilitek_sysfs_groups, 669 679 .pm = pm_sleep_ptr(&ilitek_pm_ops), 670 680 .of_match_table = of_match_ptr(ilitek_ts_i2c_match), 671 681 .acpi_match_table = ACPI_PTR(ilitekts_acpi_id),
+3 -7
drivers/input/touchscreen/iqs5xx.c
··· 974 974 return attr->mode; 975 975 } 976 976 977 - static const struct attribute_group iqs5xx_attr_group = { 977 + static const struct attribute_group iqs5xx_group = { 978 978 .is_visible = iqs5xx_attr_is_visible, 979 979 .attrs = iqs5xx_attrs, 980 980 }; 981 + __ATTRIBUTE_GROUPS(iqs5xx); 981 982 982 983 static int iqs5xx_suspend(struct device *dev) 983 984 { ··· 1054 1053 return error; 1055 1054 } 1056 1055 1057 - error = devm_device_add_group(&client->dev, &iqs5xx_attr_group); 1058 - if (error) { 1059 - dev_err(&client->dev, "Failed to add attributes: %d\n", error); 1060 - return error; 1061 - } 1062 - 1063 1056 if (iqs5xx->input) { 1064 1057 error = input_register_device(iqs5xx->input); 1065 1058 if (error) ··· 1084 1089 static struct i2c_driver iqs5xx_i2c_driver = { 1085 1090 .driver = { 1086 1091 .name = "iqs5xx", 1092 + .dev_groups = iqs5xx_groups, 1087 1093 .of_match_table = iqs5xx_of_match, 1088 1094 .pm = pm_sleep_ptr(&iqs5xx_pm), 1089 1095 },
+2 -4
drivers/input/touchscreen/mainstone-wm97xx.c
··· 252 252 return wm97xx_register_mach_ops(wm, &mainstone_mach_ops); 253 253 } 254 254 255 - static int mainstone_wm97xx_remove(struct platform_device *pdev) 255 + static void mainstone_wm97xx_remove(struct platform_device *pdev) 256 256 { 257 257 struct wm97xx *wm = platform_get_drvdata(pdev); 258 258 259 259 wm97xx_unregister_mach_ops(wm); 260 - 261 - return 0; 262 260 } 263 261 264 262 static struct platform_driver mainstone_wm97xx_driver = { 265 263 .probe = mainstone_wm97xx_probe, 266 - .remove = mainstone_wm97xx_remove, 264 + .remove_new = mainstone_wm97xx_remove, 267 265 .driver = { 268 266 .name = "wm97xx-touch", 269 267 },
+2 -4
drivers/input/touchscreen/mc13783_ts.c
··· 217 217 return ret; 218 218 } 219 219 220 - static int mc13783_ts_remove(struct platform_device *pdev) 220 + static void mc13783_ts_remove(struct platform_device *pdev) 221 221 { 222 222 struct mc13783_ts_priv *priv = platform_get_drvdata(pdev); 223 223 224 224 input_unregister_device(priv->idev); 225 225 kfree(priv); 226 - 227 - return 0; 228 226 } 229 227 230 228 static struct platform_driver mc13783_ts_driver = { 231 - .remove = mc13783_ts_remove, 229 + .remove_new = mc13783_ts_remove, 232 230 .driver = { 233 231 .name = MC13783_TS_NAME, 234 232 },
+2 -11
drivers/input/touchscreen/melfas_mip4.c
··· 1419 1419 &dev_attr_update_fw.attr, 1420 1420 NULL, 1421 1421 }; 1422 - 1423 - static const struct attribute_group mip4_attr_group = { 1424 - .attrs = mip4_attrs, 1425 - }; 1422 + ATTRIBUTE_GROUPS(mip4); 1426 1423 1427 1424 static int mip4_probe(struct i2c_client *client) 1428 1425 { ··· 1511 1514 return error; 1512 1515 } 1513 1516 1514 - error = devm_device_add_group(&client->dev, &mip4_attr_group); 1515 - if (error) { 1516 - dev_err(&client->dev, 1517 - "Failed to create sysfs attribute group: %d\n", error); 1518 - return error; 1519 - } 1520 - 1521 1517 return 0; 1522 1518 } 1523 1519 ··· 1579 1589 .probe = mip4_probe, 1580 1590 .driver = { 1581 1591 .name = MIP4_DEVICE_NAME, 1592 + .dev_groups = mip4_groups, 1582 1593 .of_match_table = of_match_ptr(mip4_of_match), 1583 1594 .acpi_match_table = ACPI_PTR(mip4_acpi_match), 1584 1595 .pm = pm_sleep_ptr(&mip4_pm_ops),
+2 -4
drivers/input/touchscreen/pcap_ts.c
··· 197 197 return err; 198 198 } 199 199 200 - static int pcap_ts_remove(struct platform_device *pdev) 200 + static void pcap_ts_remove(struct platform_device *pdev) 201 201 { 202 202 struct pcap_ts *pcap_ts = platform_get_drvdata(pdev); 203 203 ··· 207 207 input_unregister_device(pcap_ts->input); 208 208 209 209 kfree(pcap_ts); 210 - 211 - return 0; 212 210 } 213 211 214 212 #ifdef CONFIG_PM ··· 238 240 239 241 static struct platform_driver pcap_ts_driver = { 240 242 .probe = pcap_ts_probe, 241 - .remove = pcap_ts_remove, 243 + .remove_new = pcap_ts_remove, 242 244 .driver = { 243 245 .name = "pcap-ts", 244 246 .pm = PCAP_TS_PM_OPS,
+3 -13
drivers/input/touchscreen/raydium_i2c_ts.c
··· 1004 1004 static DEVICE_ATTR(update_fw, S_IWUSR, NULL, raydium_i2c_update_fw_store); 1005 1005 static DEVICE_ATTR(calibrate, S_IWUSR, NULL, raydium_i2c_calibrate_store); 1006 1006 1007 - static struct attribute *raydium_i2c_attributes[] = { 1007 + static struct attribute *raydium_i2c_attrs[] = { 1008 1008 &dev_attr_update_fw.attr, 1009 1009 &dev_attr_boot_mode.attr, 1010 1010 &dev_attr_fw_version.attr, ··· 1012 1012 &dev_attr_calibrate.attr, 1013 1013 NULL 1014 1014 }; 1015 - 1016 - static const struct attribute_group raydium_i2c_attribute_group = { 1017 - .attrs = raydium_i2c_attributes, 1018 - }; 1015 + ATTRIBUTE_GROUPS(raydium_i2c); 1019 1016 1020 1017 static int raydium_i2c_power_on(struct raydium_data *ts) 1021 1018 { ··· 1171 1174 return error; 1172 1175 } 1173 1176 1174 - error = devm_device_add_group(&client->dev, 1175 - &raydium_i2c_attribute_group); 1176 - if (error) { 1177 - dev_err(&client->dev, "failed to create sysfs attributes: %d\n", 1178 - error); 1179 - return error; 1180 - } 1181 - 1182 1177 return 0; 1183 1178 } 1184 1179 ··· 1254 1265 .id_table = raydium_i2c_id, 1255 1266 .driver = { 1256 1267 .name = "raydium_ts", 1268 + .dev_groups = raydium_i2c_groups, 1257 1269 .pm = pm_sleep_ptr(&raydium_i2c_pm_ops), 1258 1270 .acpi_match_table = ACPI_PTR(raydium_acpi_id), 1259 1271 .of_match_table = of_match_ptr(raydium_of_match),
+2 -10
drivers/input/touchscreen/rohm_bu21023.c
··· 854 854 &dev_attr_inv_y.attr, 855 855 NULL, 856 856 }; 857 - 858 - static const struct attribute_group rohm_ts_attr_group = { 859 - .attrs = rohm_ts_attrs, 860 - }; 857 + ATTRIBUTE_GROUPS(rohm_ts); 861 858 862 859 static int rohm_ts_device_init(struct i2c_client *client, u8 setup2) 863 860 { ··· 1161 1164 return error; 1162 1165 } 1163 1166 1164 - error = devm_device_add_group(dev, &rohm_ts_attr_group); 1165 - if (error) { 1166 - dev_err(dev, "failed to create sysfs group: %d\n", error); 1167 - return error; 1168 - } 1169 - 1170 1167 return error; 1171 1168 } 1172 1169 ··· 1173 1182 static struct i2c_driver rohm_bu21023_i2c_driver = { 1174 1183 .driver = { 1175 1184 .name = BU21023_NAME, 1185 + .dev_groups = rohm_ts_groups, 1176 1186 }, 1177 1187 .probe = rohm_bu21023_i2c_probe, 1178 1188 .id_table = rohm_bu21023_i2c_id,
+2 -8
drivers/input/touchscreen/s6sy761.c
··· 286 286 &dev_attr_devid.attr, 287 287 NULL 288 288 }; 289 - 290 - static struct attribute_group s6sy761_attribute_group = { 291 - .attrs = s6sy761_sysfs_attrs 292 - }; 289 + ATTRIBUTE_GROUPS(s6sy761_sysfs); 293 290 294 291 static int s6sy761_power_on(struct s6sy761_data *sdata) 295 292 { ··· 462 465 if (err) 463 466 return err; 464 467 465 - err = devm_device_add_group(&client->dev, &s6sy761_attribute_group); 466 - if (err) 467 - return err; 468 - 469 468 pm_runtime_enable(&client->dev); 470 469 471 470 return 0; ··· 528 535 static struct i2c_driver s6sy761_driver = { 529 536 .driver = { 530 537 .name = S6SY761_DEV_NAME, 538 + .dev_groups = s6sy761_sysfs_groups, 531 539 .of_match_table = of_match_ptr(s6sy761_of_match), 532 540 .pm = pm_ptr(&s6sy761_pm_ops), 533 541 },
+2 -8
drivers/input/touchscreen/stmfts.c
··· 517 517 &dev_attr_hover_enable.attr, 518 518 NULL 519 519 }; 520 - 521 - static struct attribute_group stmfts_attribute_group = { 522 - .attrs = stmfts_sysfs_attrs 523 - }; 520 + ATTRIBUTE_GROUPS(stmfts_sysfs); 524 521 525 522 static int stmfts_power_on(struct stmfts_data *sdata) 526 523 { ··· 724 727 } 725 728 } 726 729 727 - err = devm_device_add_group(&client->dev, &stmfts_attribute_group); 728 - if (err) 729 - return err; 730 - 731 730 pm_runtime_enable(&client->dev); 732 731 device_enable_async_suspend(&client->dev); 733 732 ··· 797 804 static struct i2c_driver stmfts_driver = { 798 805 .driver = { 799 806 .name = STMFTS_DEV_NAME, 807 + .dev_groups = stmfts_sysfs_groups, 800 808 .of_match_table = of_match_ptr(stmfts_of_match), 801 809 .pm = pm_ptr(&stmfts_pm_ops), 802 810 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+2 -4
drivers/input/touchscreen/stmpe-ts.c
··· 350 350 return 0; 351 351 } 352 352 353 - static int stmpe_ts_remove(struct platform_device *pdev) 353 + static void stmpe_ts_remove(struct platform_device *pdev) 354 354 { 355 355 struct stmpe_touch *ts = platform_get_drvdata(pdev); 356 356 357 357 stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); 358 - 359 - return 0; 360 358 } 361 359 362 360 static struct platform_driver stmpe_ts_driver = { ··· 362 364 .name = STMPE_TS_NAME, 363 365 }, 364 366 .probe = stmpe_input_probe, 365 - .remove = stmpe_ts_remove, 367 + .remove_new = stmpe_ts_remove, 366 368 }; 367 369 module_platform_driver(stmpe_ts_driver); 368 370
+2 -4
drivers/input/touchscreen/sun4i-ts.c
··· 375 375 return 0; 376 376 } 377 377 378 - static int sun4i_ts_remove(struct platform_device *pdev) 378 + static void sun4i_ts_remove(struct platform_device *pdev) 379 379 { 380 380 struct sun4i_ts_data *ts = platform_get_drvdata(pdev); 381 381 ··· 385 385 386 386 /* Deactivate all IRQs */ 387 387 writel(0, ts->base + TP_INT_FIFOC); 388 - 389 - return 0; 390 388 } 391 389 392 390 static const struct of_device_id sun4i_ts_of_match[] = { ··· 401 403 .of_match_table = sun4i_ts_of_match, 402 404 }, 403 405 .probe = sun4i_ts_probe, 404 - .remove = sun4i_ts_remove, 406 + .remove_new = sun4i_ts_remove, 405 407 }; 406 408 407 409 module_platform_driver(sun4i_ts_driver);
+2 -3
drivers/input/touchscreen/ti_am335x_tsc.c
··· 491 491 return err; 492 492 } 493 493 494 - static int titsc_remove(struct platform_device *pdev) 494 + static void titsc_remove(struct platform_device *pdev) 495 495 { 496 496 struct titsc *ts_dev = platform_get_drvdata(pdev); 497 497 u32 steps; ··· 508 508 input_unregister_device(ts_dev->input); 509 509 510 510 kfree(ts_dev); 511 - return 0; 512 511 } 513 512 514 513 static int titsc_suspend(struct device *dev) ··· 551 552 552 553 static struct platform_driver ti_tsc_driver = { 553 554 .probe = titsc_probe, 554 - .remove = titsc_remove, 555 + .remove_new = titsc_remove, 555 556 .driver = { 556 557 .name = "TI-am335x-tsc", 557 558 .pm = pm_sleep_ptr(&titsc_pm_ops),
+4 -3
drivers/input/touchscreen/tsc2004.c
··· 63 63 64 64 static struct i2c_driver tsc2004_driver = { 65 65 .driver = { 66 - .name = "tsc2004", 67 - .of_match_table = of_match_ptr(tsc2004_of_match), 68 - .pm = pm_sleep_ptr(&tsc200x_pm_ops), 66 + .name = "tsc2004", 67 + .dev_groups = tsc200x_groups, 68 + .of_match_table = of_match_ptr(tsc2004_of_match), 69 + .pm = pm_sleep_ptr(&tsc200x_pm_ops), 69 70 }, 70 71 .id_table = tsc2004_idtable, 71 72 .probe = tsc2004_probe,
+4 -3
drivers/input/touchscreen/tsc2005.c
··· 79 79 80 80 static struct spi_driver tsc2005_driver = { 81 81 .driver = { 82 - .name = "tsc2005", 83 - .of_match_table = of_match_ptr(tsc2005_of_match), 84 - .pm = pm_sleep_ptr(&tsc200x_pm_ops), 82 + .name = "tsc2005", 83 + .dev_groups = tsc200x_groups, 84 + .of_match_table = of_match_ptr(tsc2005_of_match), 85 + .pm = pm_sleep_ptr(&tsc200x_pm_ops), 85 86 }, 86 87 .probe = tsc2005_probe, 87 88 .remove = tsc2005_remove,
+7 -11
drivers/input/touchscreen/tsc200x-core.c
··· 356 356 .attrs = tsc200x_attrs, 357 357 }; 358 358 359 + const struct attribute_group *tsc200x_groups[] = { 360 + &tsc200x_attr_group, 361 + NULL 362 + }; 363 + EXPORT_SYMBOL_GPL(tsc200x_groups); 364 + 359 365 static void tsc200x_esd_work(struct work_struct *work) 360 366 { 361 367 struct tsc200x *ts = container_of(work, struct tsc200x, esd_work.work); ··· 559 553 return error; 560 554 561 555 dev_set_drvdata(dev, ts); 562 - error = sysfs_create_group(&dev->kobj, &tsc200x_attr_group); 563 - if (error) { 564 - dev_err(dev, 565 - "Failed to create sysfs attributes, err: %d\n", error); 566 - goto disable_regulator; 567 - } 568 556 569 557 error = input_register_device(ts->idev); 570 558 if (error) { 571 559 dev_err(dev, 572 560 "Failed to register input device, err: %d\n", error); 573 - goto err_remove_sysfs; 561 + goto disable_regulator; 574 562 } 575 563 576 564 irq_set_irq_wake(irq, 1); 577 565 return 0; 578 566 579 - err_remove_sysfs: 580 - sysfs_remove_group(&dev->kobj, &tsc200x_attr_group); 581 567 disable_regulator: 582 568 regulator_disable(ts->vio); 583 569 return error; ··· 579 581 void tsc200x_remove(struct device *dev) 580 582 { 581 583 struct tsc200x *ts = dev_get_drvdata(dev); 582 - 583 - sysfs_remove_group(&dev->kobj, &tsc200x_attr_group); 584 584 585 585 regulator_disable(ts->vio); 586 586 }
+1
drivers/input/touchscreen/tsc200x-core.h
··· 70 70 71 71 extern const struct regmap_config tsc200x_regmap_config; 72 72 extern const struct dev_pm_ops tsc200x_pm_ops; 73 + extern const struct attribute_group *tsc200x_groups[]; 73 74 74 75 int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, 75 76 struct regmap *regmap,
+4 -12
drivers/input/touchscreen/wdt87xx_i2c.c
··· 944 944 &dev_attr_update_fw.attr, 945 945 NULL 946 946 }; 947 - 948 - static const struct attribute_group wdt87xx_attr_group = { 949 - .attrs = wdt87xx_attrs, 950 - }; 947 + ATTRIBUTE_GROUPS(wdt87xx); 951 948 952 949 static void wdt87xx_report_contact(struct input_dev *input, 953 950 struct wdt87xx_sys_param *param, ··· 1101 1104 return error; 1102 1105 } 1103 1106 1104 - error = devm_device_add_group(&client->dev, &wdt87xx_attr_group); 1105 - if (error) { 1106 - dev_err(&client->dev, "create sysfs failed: %d\n", error); 1107 - return error; 1108 - } 1109 - 1110 1107 return 0; 1111 1108 } 1112 1109 ··· 1163 1172 .probe = wdt87xx_ts_probe, 1164 1173 .id_table = wdt87xx_dev_id, 1165 1174 .driver = { 1166 - .name = WDT87XX_NAME, 1167 - .pm = pm_sleep_ptr(&wdt87xx_pm_ops), 1175 + .name = WDT87XX_NAME, 1176 + .dev_groups = wdt87xx_groups, 1177 + .pm = pm_sleep_ptr(&wdt87xx_pm_ops), 1168 1178 .acpi_match_table = ACPI_PTR(wdt87xx_acpi_id), 1169 1179 }, 1170 1180 };
+2 -4
drivers/input/touchscreen/wm831x-ts.c
··· 374 374 return error; 375 375 } 376 376 377 - static int wm831x_ts_remove(struct platform_device *pdev) 377 + static void wm831x_ts_remove(struct platform_device *pdev) 378 378 { 379 379 struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); 380 380 381 381 free_irq(wm831x_ts->pd_irq, wm831x_ts); 382 382 free_irq(wm831x_ts->data_irq, wm831x_ts); 383 - 384 - return 0; 385 383 } 386 384 387 385 static struct platform_driver wm831x_ts_driver = { ··· 387 389 .name = "wm831x-touch", 388 390 }, 389 391 .probe = wm831x_ts_probe, 390 - .remove = wm831x_ts_remove, 392 + .remove_new = wm831x_ts_remove, 391 393 }; 392 394 module_platform_driver(wm831x_ts_driver); 393 395
+2 -4
drivers/input/touchscreen/wm97xx-core.c
··· 756 756 return ret; 757 757 } 758 758 759 - static int wm97xx_mfd_remove(struct platform_device *pdev) 759 + static void wm97xx_mfd_remove(struct platform_device *pdev) 760 760 { 761 761 wm97xx_remove(&pdev->dev); 762 - 763 - return 0; 764 762 } 765 763 766 764 static int wm97xx_suspend(struct device *dev) ··· 876 878 .pm = pm_sleep_ptr(&wm97xx_pm_ops), 877 879 }, 878 880 .probe = wm97xx_mfd_probe, 879 - .remove = wm97xx_mfd_remove, 881 + .remove_new = wm97xx_mfd_remove, 880 882 }; 881 883 882 884 static int __init wm97xx_init(void)
+1 -1
include/linux/input.h
··· 562 562 563 563 int max_effects; 564 564 struct ff_effect *effects; 565 - struct file *effect_owners[]; 565 + struct file *effect_owners[] __counted_by(max_effects); 566 566 }; 567 567 568 568 int input_ff_create(struct input_dev *dev, unsigned int max_effects);
+1 -1
include/linux/input/mt.h
··· 47 47 unsigned int flags; 48 48 unsigned int frame; 49 49 int *red; 50 - struct input_mt_slot slots[]; 50 + struct input_mt_slot slots[] __counted_by(num_slots); 51 51 }; 52 52 53 53 static inline void input_mt_set_value(struct input_mt_slot *slot,