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

Merge tag 'tag-chrome-platform-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform updates from Tzung-Bi Shih:
"Improvements:

- Annotate flexible array members with __counted_by

- Convert platform drivers' .remove callbacks to return void

Fixes:

- Avoid MKBP event timeouts by disabling/enabling IRQ later/earlier

Misc:

- Minor cleanups and fixes"

* tag 'tag-chrome-platform-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: (21 commits)
platform/chrome: cros_ec_lpc: Separate host command and irq disable
platform/chrome: kunit: make EC protocol tests independent
platform/chrome: kunit: initialize lock for fake ec_dev
platform/chrome: cros_ec: fix compilation warning
platform/chrome: cros_ec_proto: Mark outdata as const
platform/chrome: cros_typec_vdm: Mark port_amode_ops const
platform/chrome: cros_ec_typec: Use dev_err_probe() more
platform/chrome: cros_ec_typec: Use semi-colons instead of commas
platform/chrome/wilco_ec: telemetry: Convert to platform remove callback returning void
platform/chrome/wilco_ec: debugfs: Convert to platform remove callback returning void
platform/chrome/wilco_ec: core: Convert to platform remove callback returning void
platform/chrome: cros_usbpd_notify: Convert to platform remove callback returning void
platform/chrome: cros_usbpd_logger: Convert to platform remove callback returning void
platform/chrome: cros_typec_switch: Convert to platform remove callback returning void
platform/chrome: cros_ec_vbc: Convert to platform remove callback returning void
platform/chrome: cros_ec_sysfs: Convert to platform remove callback returning void
platform/chrome: cros_ec_lpc: Convert to platform remove callback returning void
platform/chrome: cros_ec_lightbar: Convert to platform remove callback returning void
platform/chrome: cros_ec_debugfs: Convert to platform remove callback returning void
platform/chrome: cros_ec_chardev: Convert to platform remove callback returning void
...

+166 -100
+3 -3
drivers/platform/chrome/Kconfig
··· 299 299 source "drivers/platform/chrome/wilco_ec/Kconfig" 300 300 301 301 # Kunit test cases 302 - config CROS_KUNIT 303 - tristate "Kunit tests for ChromeOS" if !KUNIT_ALL_TESTS 302 + config CROS_KUNIT_EC_PROTO_TEST 303 + tristate "Kunit tests for ChromeOS EC protocol" if !KUNIT_ALL_TESTS 304 304 depends on KUNIT && CROS_EC 305 305 default KUNIT_ALL_TESTS 306 306 select CROS_EC_PROTO 307 307 help 308 - ChromeOS Kunit tests. 308 + Kunit tests for ChromeOS EC protocol. 309 309 310 310 endif # CHROMEOS_PLATFORMS
+2 -3
drivers/platform/chrome/Makefile
··· 36 36 obj-$(CONFIG_WILCO_EC) += wilco_ec/ 37 37 38 38 # Kunit test cases 39 - obj-$(CONFIG_CROS_KUNIT) += cros_kunit.o 40 - cros_kunit-objs := cros_kunit_util.o 41 - cros_kunit-objs += cros_ec_proto_test.o 39 + obj-$(CONFIG_CROS_KUNIT_EC_PROTO_TEST) += cros_kunit_proto_test.o 40 + cros_kunit_proto_test-objs := cros_ec_proto_test_util.o cros_ec_proto_test.o
+94 -22
drivers/platform/chrome/cros_ec.c
··· 321 321 EXPORT_SYMBOL(cros_ec_unregister); 322 322 323 323 #ifdef CONFIG_PM_SLEEP 324 - /** 325 - * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device. 326 - * @ec_dev: Device to suspend. 327 - * 328 - * This can be called by drivers to handle a suspend event. 329 - * 330 - * Return: 0 on success or negative error code. 331 - */ 332 - int cros_ec_suspend(struct cros_ec_device *ec_dev) 324 + static void cros_ec_send_suspend_event(struct cros_ec_device *ec_dev) 333 325 { 334 - struct device *dev = ec_dev->dev; 335 326 int ret; 336 327 u8 sleep_event; 337 328 ··· 334 343 if (ret < 0) 335 344 dev_dbg(ec_dev->dev, "Error %d sending suspend event to ec\n", 336 345 ret); 346 + } 337 347 348 + /** 349 + * cros_ec_suspend_prepare() - Handle a suspend prepare operation for the ChromeOS EC device. 350 + * @ec_dev: Device to suspend. 351 + * 352 + * This can be called by drivers to handle a suspend prepare stage of suspend. 353 + * 354 + * Return: 0 always. 355 + */ 356 + int cros_ec_suspend_prepare(struct cros_ec_device *ec_dev) 357 + { 358 + cros_ec_send_suspend_event(ec_dev); 359 + return 0; 360 + } 361 + EXPORT_SYMBOL(cros_ec_suspend_prepare); 362 + 363 + static void cros_ec_disable_irq(struct cros_ec_device *ec_dev) 364 + { 365 + struct device *dev = ec_dev->dev; 338 366 if (device_may_wakeup(dev)) 339 367 ec_dev->wake_enabled = !enable_irq_wake(ec_dev->irq); 340 368 else ··· 361 351 362 352 disable_irq(ec_dev->irq); 363 353 ec_dev->suspended = true; 354 + } 364 355 356 + /** 357 + * cros_ec_suspend_late() - Handle a suspend late operation for the ChromeOS EC device. 358 + * @ec_dev: Device to suspend. 359 + * 360 + * This can be called by drivers to handle a suspend late stage of suspend. 361 + * 362 + * Return: 0 always. 363 + */ 364 + int cros_ec_suspend_late(struct cros_ec_device *ec_dev) 365 + { 366 + cros_ec_disable_irq(ec_dev); 367 + return 0; 368 + } 369 + EXPORT_SYMBOL(cros_ec_suspend_late); 370 + 371 + /** 372 + * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device. 373 + * @ec_dev: Device to suspend. 374 + * 375 + * This can be called by drivers to handle a suspend event. 376 + * 377 + * Return: 0 always. 378 + */ 379 + int cros_ec_suspend(struct cros_ec_device *ec_dev) 380 + { 381 + cros_ec_send_suspend_event(ec_dev); 382 + cros_ec_disable_irq(ec_dev); 365 383 return 0; 366 384 } 367 385 EXPORT_SYMBOL(cros_ec_suspend); ··· 408 370 } 409 371 } 410 372 411 - /** 412 - * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device. 413 - * @ec_dev: Device to resume. 414 - * 415 - * This can be called by drivers to handle a resume event. 416 - * 417 - * Return: 0 on success or negative error code. 418 - */ 419 - int cros_ec_resume(struct cros_ec_device *ec_dev) 373 + static void cros_ec_send_resume_event(struct cros_ec_device *ec_dev) 420 374 { 421 375 int ret; 422 376 u8 sleep_event; 423 - 424 - ec_dev->suspended = false; 425 - enable_irq(ec_dev->irq); 426 377 427 378 sleep_event = (!IS_ENABLED(CONFIG_ACPI) || pm_suspend_via_firmware()) ? 428 379 HOST_SLEEP_EVENT_S3_RESUME : ··· 421 394 if (ret < 0) 422 395 dev_dbg(ec_dev->dev, "Error %d sending resume event to ec\n", 423 396 ret); 397 + } 398 + 399 + /** 400 + * cros_ec_resume_complete() - Handle a resume complete operation for the ChromeOS EC device. 401 + * @ec_dev: Device to resume. 402 + * 403 + * This can be called by drivers to handle a resume complete stage of resume. 404 + */ 405 + void cros_ec_resume_complete(struct cros_ec_device *ec_dev) 406 + { 407 + cros_ec_send_resume_event(ec_dev); 408 + } 409 + EXPORT_SYMBOL(cros_ec_resume_complete); 410 + 411 + static void cros_ec_enable_irq(struct cros_ec_device *ec_dev) 412 + { 413 + ec_dev->suspended = false; 414 + enable_irq(ec_dev->irq); 424 415 425 416 if (ec_dev->wake_enabled) 426 417 disable_irq_wake(ec_dev->irq); ··· 448 403 * suspend. This way the clients know what to do with them. 449 404 */ 450 405 cros_ec_report_events_during_suspend(ec_dev); 406 + } 451 407 408 + /** 409 + * cros_ec_resume_early() - Handle a resume early operation for the ChromeOS EC device. 410 + * @ec_dev: Device to resume. 411 + * 412 + * This can be called by drivers to handle a resume early stage of resume. 413 + * 414 + * Return: 0 always. 415 + */ 416 + int cros_ec_resume_early(struct cros_ec_device *ec_dev) 417 + { 418 + cros_ec_enable_irq(ec_dev); 419 + return 0; 420 + } 421 + EXPORT_SYMBOL(cros_ec_resume_early); 452 422 423 + /** 424 + * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device. 425 + * @ec_dev: Device to resume. 426 + * 427 + * This can be called by drivers to handle a resume event. 428 + * 429 + * Return: 0 always. 430 + */ 431 + int cros_ec_resume(struct cros_ec_device *ec_dev) 432 + { 433 + cros_ec_enable_irq(ec_dev); 434 + cros_ec_send_resume_event(ec_dev); 453 435 return 0; 454 436 } 455 437 EXPORT_SYMBOL(cros_ec_resume);
+6
drivers/platform/chrome/cros_ec.h
··· 10 10 11 11 #include <linux/interrupt.h> 12 12 13 + struct cros_ec_device; 14 + 13 15 int cros_ec_register(struct cros_ec_device *ec_dev); 14 16 void cros_ec_unregister(struct cros_ec_device *ec_dev); 15 17 16 18 int cros_ec_suspend(struct cros_ec_device *ec_dev); 19 + int cros_ec_suspend_late(struct cros_ec_device *ec_dev); 20 + int cros_ec_suspend_prepare(struct cros_ec_device *ec_dev); 17 21 int cros_ec_resume(struct cros_ec_device *ec_dev); 22 + int cros_ec_resume_early(struct cros_ec_device *ec_dev); 23 + void cros_ec_resume_complete(struct cros_ec_device *ec_dev); 18 24 19 25 irqreturn_t cros_ec_irq_thread(int irq, void *data); 20 26
+2 -4
drivers/platform/chrome/cros_ec_chardev.c
··· 396 396 return misc_register(&data->misc); 397 397 } 398 398 399 - static int cros_ec_chardev_remove(struct platform_device *pdev) 399 + static void cros_ec_chardev_remove(struct platform_device *pdev) 400 400 { 401 401 struct chardev_data *data = dev_get_drvdata(&pdev->dev); 402 402 403 403 misc_deregister(&data->misc); 404 - 405 - return 0; 406 404 } 407 405 408 406 static struct platform_driver cros_ec_chardev_driver = { ··· 408 410 .name = DRV_NAME, 409 411 }, 410 412 .probe = cros_ec_chardev_probe, 411 - .remove = cros_ec_chardev_remove, 413 + .remove_new = cros_ec_chardev_remove, 412 414 }; 413 415 414 416 module_platform_driver(cros_ec_chardev_driver);
+2 -4
drivers/platform/chrome/cros_ec_debugfs.c
··· 533 533 return ret; 534 534 } 535 535 536 - static int cros_ec_debugfs_remove(struct platform_device *pd) 536 + static void cros_ec_debugfs_remove(struct platform_device *pd) 537 537 { 538 538 struct cros_ec_dev *ec = dev_get_drvdata(pd->dev.parent); 539 539 540 540 debugfs_remove_recursive(ec->debug_info->dir); 541 541 cros_ec_cleanup_console_log(ec->debug_info); 542 - 543 - return 0; 544 542 } 545 543 546 544 static int __maybe_unused cros_ec_debugfs_suspend(struct device *dev) ··· 571 573 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 572 574 }, 573 575 .probe = cros_ec_debugfs_probe, 574 - .remove = cros_ec_debugfs_remove, 576 + .remove_new = cros_ec_debugfs_remove, 575 577 }; 576 578 577 579 module_platform_driver(cros_ec_debugfs_driver);
+2 -4
drivers/platform/chrome/cros_ec_lightbar.c
··· 560 560 return ret; 561 561 } 562 562 563 - static int cros_ec_lightbar_remove(struct platform_device *pd) 563 + static void cros_ec_lightbar_remove(struct platform_device *pd) 564 564 { 565 565 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); 566 566 ··· 569 569 570 570 /* Let the EC take over the lightbar again. */ 571 571 lb_manual_suspend_ctrl(ec_dev, 0); 572 - 573 - return 0; 574 572 } 575 573 576 574 static int __maybe_unused cros_ec_lightbar_resume(struct device *dev) ··· 601 603 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 602 604 }, 603 605 .probe = cros_ec_lightbar_probe, 604 - .remove = cros_ec_lightbar_remove, 606 + .remove_new = cros_ec_lightbar_remove, 605 607 }; 606 608 607 609 module_platform_driver(cros_ec_lightbar_driver);
+20 -8
drivers/platform/chrome/cros_ec_lpc.c
··· 460 460 return 0; 461 461 } 462 462 463 - static int cros_ec_lpc_remove(struct platform_device *pdev) 463 + static void cros_ec_lpc_remove(struct platform_device *pdev) 464 464 { 465 465 struct cros_ec_device *ec_dev = platform_get_drvdata(pdev); 466 466 struct acpi_device *adev; ··· 471 471 cros_ec_lpc_acpi_notify); 472 472 473 473 cros_ec_unregister(ec_dev); 474 - 475 - return 0; 476 474 } 477 475 478 476 static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = { ··· 547 549 static int cros_ec_lpc_prepare(struct device *dev) 548 550 { 549 551 struct cros_ec_device *ec_dev = dev_get_drvdata(dev); 550 - 551 - return cros_ec_suspend(ec_dev); 552 + return cros_ec_suspend_prepare(ec_dev); 552 553 } 553 554 554 555 static void cros_ec_lpc_complete(struct device *dev) 555 556 { 556 557 struct cros_ec_device *ec_dev = dev_get_drvdata(dev); 557 - cros_ec_resume(ec_dev); 558 + cros_ec_resume_complete(ec_dev); 559 + } 560 + 561 + static int cros_ec_lpc_suspend_late(struct device *dev) 562 + { 563 + struct cros_ec_device *ec_dev = dev_get_drvdata(dev); 564 + 565 + return cros_ec_suspend_late(ec_dev); 566 + } 567 + 568 + static int cros_ec_lpc_resume_early(struct device *dev) 569 + { 570 + struct cros_ec_device *ec_dev = dev_get_drvdata(dev); 571 + 572 + return cros_ec_resume_early(ec_dev); 558 573 } 559 574 #endif 560 575 561 576 static const struct dev_pm_ops cros_ec_lpc_pm_ops = { 562 577 #ifdef CONFIG_PM_SLEEP 563 578 .prepare = cros_ec_lpc_prepare, 564 - .complete = cros_ec_lpc_complete 579 + .complete = cros_ec_lpc_complete, 565 580 #endif 581 + SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend_late, cros_ec_lpc_resume_early) 566 582 }; 567 583 568 584 static struct platform_driver cros_ec_lpc_driver = { ··· 592 580 .probe_type = PROBE_FORCE_SYNCHRONOUS, 593 581 }, 594 582 .probe = cros_ec_lpc_probe, 595 - .remove = cros_ec_lpc_remove, 583 + .remove_new = cros_ec_lpc_remove, 596 584 }; 597 585 598 586 static struct platform_device cros_ec_lpc_device = {
+1 -1
drivers/platform/chrome/cros_ec_proto.c
··· 1004 1004 int cros_ec_cmd(struct cros_ec_device *ec_dev, 1005 1005 unsigned int version, 1006 1006 int command, 1007 - void *outdata, 1007 + const void *outdata, 1008 1008 size_t outsize, 1009 1009 void *indata, 1010 1010 size_t insize)
+2 -1
drivers/platform/chrome/cros_ec_proto_test.c
··· 11 11 #include <linux/platform_data/cros_ec_proto.h> 12 12 13 13 #include "cros_ec.h" 14 - #include "cros_kunit_util.h" 14 + #include "cros_ec_proto_test_util.h" 15 15 16 16 #define BUFSIZE 512 17 17 ··· 2668 2668 ec_dev->dev->release = cros_ec_proto_test_release; 2669 2669 ec_dev->cmd_xfer = cros_kunit_ec_xfer_mock; 2670 2670 ec_dev->pkt_xfer = cros_kunit_ec_xfer_mock; 2671 + mutex_init(&ec_dev->lock); 2671 2672 2672 2673 priv->msg = (struct cros_ec_command *)priv->_msg; 2673 2674
+2 -4
drivers/platform/chrome/cros_ec_sysfs.c
··· 340 340 return ret; 341 341 } 342 342 343 - static int cros_ec_sysfs_remove(struct platform_device *pd) 343 + static void cros_ec_sysfs_remove(struct platform_device *pd) 344 344 { 345 345 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); 346 346 347 347 sysfs_remove_group(&ec_dev->class_dev.kobj, &cros_ec_attr_group); 348 - 349 - return 0; 350 348 } 351 349 352 350 static struct platform_driver cros_ec_sysfs_driver = { ··· 352 354 .name = DRV_NAME, 353 355 }, 354 356 .probe = cros_ec_sysfs_probe, 355 - .remove = cros_ec_sysfs_remove, 357 + .remove_new = cros_ec_sysfs_remove, 356 358 }; 357 359 358 360 module_platform_driver(cros_ec_sysfs_driver);
+9 -9
drivers/platform/chrome/cros_ec_typec.c
··· 80 80 port->mux = fwnode_typec_mux_get(fwnode); 81 81 if (IS_ERR(port->mux)) { 82 82 ret = PTR_ERR(port->mux); 83 - dev_dbg(dev, "Mux handle not found: %d.\n", ret); 83 + dev_err_probe(dev, ret, "Mux handle not found\n"); 84 84 goto mux_err; 85 85 } 86 86 87 87 port->retimer = fwnode_typec_retimer_get(fwnode); 88 88 if (IS_ERR(port->retimer)) { 89 89 ret = PTR_ERR(port->retimer); 90 - dev_dbg(dev, "Retimer handle not found: %d.\n", ret); 90 + dev_err_probe(dev, ret, "Retimer handle not found\n"); 91 91 goto retimer_sw_err; 92 92 } 93 93 94 94 port->ori_sw = fwnode_typec_switch_get(fwnode); 95 95 if (IS_ERR(port->ori_sw)) { 96 96 ret = PTR_ERR(port->ori_sw); 97 - dev_dbg(dev, "Orientation switch handle not found: %d\n", ret); 97 + dev_err_probe(dev, ret, "Orientation switch handle not found\n"); 98 98 goto ori_sw_err; 99 99 } 100 100 101 101 port->role_sw = fwnode_usb_role_switch_get(fwnode); 102 102 if (IS_ERR(port->role_sw)) { 103 103 ret = PTR_ERR(port->role_sw); 104 - dev_dbg(dev, "USB role switch handle not found: %d\n", ret); 104 + dev_err_probe(dev, ret, "USB role switch handle not found\n"); 105 105 goto role_sw_err; 106 106 } 107 107 ··· 271 271 struct typec_altmode *amode; 272 272 273 273 /* All PD capable CrOS devices are assumed to support DP altmode. */ 274 - desc.svid = USB_TYPEC_DP_SID, 275 - desc.mode = USB_TYPEC_DP_MODE, 276 - desc.vdo = DP_PORT_VDO, 274 + desc.svid = USB_TYPEC_DP_SID; 275 + desc.mode = USB_TYPEC_DP_MODE; 276 + desc.vdo = DP_PORT_VDO; 277 277 amode = typec_port_register_altmode(port->port, &desc); 278 278 if (IS_ERR(amode)) 279 279 return PTR_ERR(amode); ··· 287 287 * here for now. 288 288 */ 289 289 memset(&desc, 0, sizeof(desc)); 290 - desc.svid = USB_TYPEC_TBT_SID, 291 - desc.mode = TYPEC_ANY_MODE, 290 + desc.svid = USB_TYPEC_TBT_SID; 291 + desc.mode = TYPEC_ANY_MODE; 292 292 amode = typec_port_register_altmode(port->port, &desc); 293 293 if (IS_ERR(amode)) 294 294 return PTR_ERR(amode);
+2 -4
drivers/platform/chrome/cros_ec_vbc.c
··· 121 121 return ret; 122 122 } 123 123 124 - static int cros_ec_vbc_remove(struct platform_device *pd) 124 + static void cros_ec_vbc_remove(struct platform_device *pd) 125 125 { 126 126 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); 127 127 128 128 sysfs_remove_group(&ec_dev->class_dev.kobj, 129 129 &cros_ec_vbc_attr_group); 130 - 131 - return 0; 132 130 } 133 131 134 132 static struct platform_driver cros_ec_vbc_driver = { ··· 134 136 .name = DRV_NAME, 135 137 }, 136 138 .probe = cros_ec_vbc_probe, 137 - .remove = cros_ec_vbc_remove, 139 + .remove_new = cros_ec_vbc_remove, 138 140 }; 139 141 140 142 module_platform_driver(cros_ec_vbc_driver);
+1 -3
drivers/platform/chrome/cros_kunit_util.c drivers/platform/chrome/cros_ec_proto_test_util.c
··· 11 11 #include <linux/platform_data/cros_ec_proto.h> 12 12 13 13 #include "cros_ec.h" 14 - #include "cros_kunit_util.h" 14 + #include "cros_ec_proto_test_util.h" 15 15 16 16 int cros_kunit_ec_xfer_mock_default_result; 17 17 int cros_kunit_ec_xfer_mock_default_ret; ··· 126 126 cros_kunit_readmem_mock_data = NULL; 127 127 cros_kunit_readmem_mock_ret = 0; 128 128 } 129 - 130 - MODULE_LICENSE("GPL");
drivers/platform/chrome/cros_kunit_util.h drivers/platform/chrome/cros_ec_proto_test_util.h
+2 -3
drivers/platform/chrome/cros_typec_switch.c
··· 297 297 return cros_typec_register_switches(sdata); 298 298 } 299 299 300 - static int cros_typec_switch_remove(struct platform_device *pdev) 300 + static void cros_typec_switch_remove(struct platform_device *pdev) 301 301 { 302 302 struct cros_typec_switch_data *sdata = platform_get_drvdata(pdev); 303 303 304 304 cros_typec_unregister_switches(sdata); 305 - return 0; 306 305 } 307 306 308 307 #ifdef CONFIG_ACPI ··· 318 319 .acpi_match_table = ACPI_PTR(cros_typec_switch_acpi_id), 319 320 }, 320 321 .probe = cros_typec_switch_probe, 321 - .remove = cros_typec_switch_remove, 322 + .remove_new = cros_typec_switch_remove, 322 323 }; 323 324 324 325 module_platform_driver(cros_typec_switch_driver);
+1 -1
drivers/platform/chrome/cros_typec_vdm.c
··· 142 142 sizeof(req), NULL, 0); 143 143 } 144 144 145 - struct typec_altmode_ops port_amode_ops = { 145 + const struct typec_altmode_ops port_amode_ops = { 146 146 .enter = cros_typec_port_amode_enter, 147 147 .vdm = cros_typec_port_amode_vdm, 148 148 };
+1 -1
drivers/platform/chrome/cros_typec_vdm.h
··· 5 5 6 6 #include <linux/usb/typec_altmode.h> 7 7 8 - extern struct typec_altmode_ops port_amode_ops; 8 + extern const struct typec_altmode_ops port_amode_ops; 9 9 10 10 void cros_typec_handle_vdm_attention(struct cros_typec_data *typec, int port_num); 11 11 void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num);
+2 -4
drivers/platform/chrome/cros_usbpd_logger.c
··· 219 219 return 0; 220 220 } 221 221 222 - static int cros_usbpd_logger_remove(struct platform_device *pd) 222 + static void cros_usbpd_logger_remove(struct platform_device *pd) 223 223 { 224 224 struct logger_data *logger = platform_get_drvdata(pd); 225 225 226 226 cancel_delayed_work_sync(&logger->log_work); 227 227 destroy_workqueue(logger->log_workqueue); 228 - 229 - return 0; 230 228 } 231 229 232 230 static int __maybe_unused cros_usbpd_logger_resume(struct device *dev) ··· 255 257 .pm = &cros_usbpd_logger_pm_ops, 256 258 }, 257 259 .probe = cros_usbpd_logger_probe, 258 - .remove = cros_usbpd_logger_remove, 260 + .remove_new = cros_usbpd_logger_remove, 259 261 }; 260 262 261 263 module_platform_driver(cros_usbpd_logger_driver);
+4 -8
drivers/platform/chrome/cros_usbpd_notify.c
··· 134 134 return 0; 135 135 } 136 136 137 - static int cros_usbpd_notify_remove_acpi(struct platform_device *pdev) 137 + static void cros_usbpd_notify_remove_acpi(struct platform_device *pdev) 138 138 { 139 139 struct device *dev = &pdev->dev; 140 140 struct acpi_device *adev = ACPI_COMPANION(dev); 141 141 142 142 acpi_remove_notify_handler(adev->handle, ACPI_ALL_NOTIFY, 143 143 cros_usbpd_notify_acpi); 144 - 145 - return 0; 146 144 } 147 145 148 146 static const struct acpi_device_id cros_usbpd_notify_acpi_device_ids[] = { ··· 155 157 .acpi_match_table = cros_usbpd_notify_acpi_device_ids, 156 158 }, 157 159 .probe = cros_usbpd_notify_probe_acpi, 158 - .remove = cros_usbpd_notify_remove_acpi, 160 + .remove_new = cros_usbpd_notify_remove_acpi, 159 161 }; 160 162 161 163 #endif /* CONFIG_ACPI */ ··· 207 209 return 0; 208 210 } 209 211 210 - static int cros_usbpd_notify_remove_plat(struct platform_device *pdev) 212 + static void cros_usbpd_notify_remove_plat(struct platform_device *pdev) 211 213 { 212 214 struct device *dev = &pdev->dev; 213 215 struct cros_ec_dev *ecdev = dev_get_drvdata(dev->parent); ··· 216 218 217 219 blocking_notifier_chain_unregister(&ecdev->ec_dev->event_notifier, 218 220 &pdnotify->nb); 219 - 220 - return 0; 221 221 } 222 222 223 223 static struct platform_driver cros_usbpd_notify_plat_driver = { ··· 223 227 .name = DRV_NAME, 224 228 }, 225 229 .probe = cros_usbpd_notify_probe_plat, 226 - .remove = cros_usbpd_notify_remove_plat, 230 + .remove_new = cros_usbpd_notify_remove_plat, 227 231 }; 228 232 229 233 static int __init cros_usbpd_notify_init(void)
+2 -3
drivers/platform/chrome/wilco_ec/core.c
··· 132 132 return ret; 133 133 } 134 134 135 - static int wilco_ec_remove(struct platform_device *pdev) 135 + static void wilco_ec_remove(struct platform_device *pdev) 136 136 { 137 137 struct wilco_ec_device *ec = platform_get_drvdata(pdev); 138 138 ··· 142 142 platform_device_unregister(ec->rtc_pdev); 143 143 if (ec->debugfs_pdev) 144 144 platform_device_unregister(ec->debugfs_pdev); 145 - return 0; 146 145 } 147 146 148 147 static const struct acpi_device_id wilco_ec_acpi_device_ids[] = { ··· 156 157 .acpi_match_table = wilco_ec_acpi_device_ids, 157 158 }, 158 159 .probe = wilco_ec_probe, 159 - .remove = wilco_ec_remove, 160 + .remove_new = wilco_ec_remove, 160 161 }; 161 162 162 163 module_platform_driver(wilco_ec_driver);
+2 -4
drivers/platform/chrome/wilco_ec/debugfs.c
··· 260 260 return 0; 261 261 } 262 262 263 - static int wilco_ec_debugfs_remove(struct platform_device *pdev) 263 + static void wilco_ec_debugfs_remove(struct platform_device *pdev) 264 264 { 265 265 debugfs_remove_recursive(debug_info->dir); 266 - 267 - return 0; 268 266 } 269 267 270 268 static struct platform_driver wilco_ec_debugfs_driver = { ··· 270 272 .name = DRV_NAME, 271 273 }, 272 274 .probe = wilco_ec_debugfs_probe, 273 - .remove = wilco_ec_debugfs_remove, 275 + .remove_new = wilco_ec_debugfs_remove, 274 276 }; 275 277 276 278 module_platform_driver(wilco_ec_debugfs_driver);
+1 -1
drivers/platform/chrome/wilco_ec/event.c
··· 95 95 int capacity; 96 96 int head; 97 97 int tail; 98 - struct ec_event *entries[]; 98 + struct ec_event *entries[] __counted_by(capacity); 99 99 }; 100 100 101 101 /* Maximum number of events to store in ec_event_queue */
+2 -4
drivers/platform/chrome/wilco_ec/telemetry.c
··· 400 400 return 0; 401 401 } 402 402 403 - static int telem_device_remove(struct platform_device *pdev) 403 + static void telem_device_remove(struct platform_device *pdev) 404 404 { 405 405 struct telem_device_data *dev_data = platform_get_drvdata(pdev); 406 406 407 407 cdev_device_del(&dev_data->cdev, &dev_data->dev); 408 408 ida_simple_remove(&telem_ida, MINOR(dev_data->dev.devt)); 409 409 put_device(&dev_data->dev); 410 - 411 - return 0; 412 410 } 413 411 414 412 static struct platform_driver telem_driver = { 415 413 .probe = telem_device_probe, 416 - .remove = telem_device_remove, 414 + .remove_new = telem_device_remove, 417 415 .driver = { 418 416 .name = DRV_NAME, 419 417 },
+1 -1
include/linux/platform_data/cros_ec_proto.h
··· 258 258 259 259 int cros_ec_get_sensor_count(struct cros_ec_dev *ec); 260 260 261 - int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata, 261 + int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, const void *outdata, 262 262 size_t outsize, void *indata, size_t insize); 263 263 264 264 /**