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

ACPI: make remove callback of ACPI driver void

For bus-based driver, device removal is implemented as:
1 device_remove()->
2 bus->remove()->
3 driver->remove()

Driver core needs no inform from callee(bus driver) about the
result of remove callback. In that case, commit fc7a6209d571
("bus: Make remove callback return void") forces bus_type::remove
be void-returned.

Now we have the situation that both 1 & 2 of calling chain are
void-returned, so it does not make much sense for 3(driver->remove)
to return non-void to its caller.

So the basic idea behind this change is making remove() callback of
any bus-based driver to be void-returned.

This change, for itself, is for device drivers based on acpi-bus.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dawei Li <set_pte_at@outlook.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for drivers/platform/surface/*
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Dawei Li and committed by
Rafael J. Wysocki
6c0eb5ba d7d43321

+88 -149
+2 -2
arch/ia64/hp/common/aml_nfw.c
··· 187 187 return aml_nfw_add_global_handler(); 188 188 } 189 189 190 - static int aml_nfw_remove(struct acpi_device *device) 190 + static void aml_nfw_remove(struct acpi_device *device) 191 191 { 192 - return aml_nfw_remove_global_handler(); 192 + aml_nfw_remove_global_handler(); 193 193 } 194 194 195 195 static const struct acpi_device_id aml_nfw_ids[] = {
+1 -2
arch/x86/platform/olpc/olpc-xo15-sci.c
··· 183 183 return r; 184 184 } 185 185 186 - static int xo15_sci_remove(struct acpi_device *device) 186 + static void xo15_sci_remove(struct acpi_device *device) 187 187 { 188 188 acpi_disable_gpe(NULL, xo15_sci_gpe); 189 189 acpi_remove_gpe_handler(NULL, xo15_sci_gpe, xo15_sci_gpe_handler); 190 190 cancel_work_sync(&sci_work); 191 191 sysfs_remove_file(&device->dev.kobj, &lid_wake_on_close_attr.attr); 192 - return 0; 193 192 } 194 193 195 194 #ifdef CONFIG_PM_SLEEP
+3 -5
drivers/acpi/ac.c
··· 33 33 MODULE_LICENSE("GPL"); 34 34 35 35 static int acpi_ac_add(struct acpi_device *device); 36 - static int acpi_ac_remove(struct acpi_device *device); 36 + static void acpi_ac_remove(struct acpi_device *device); 37 37 static void acpi_ac_notify(struct acpi_device *device, u32 event); 38 38 39 39 static const struct acpi_device_id ac_device_ids[] = { ··· 288 288 #define acpi_ac_resume NULL 289 289 #endif 290 290 291 - static int acpi_ac_remove(struct acpi_device *device) 291 + static void acpi_ac_remove(struct acpi_device *device) 292 292 { 293 293 struct acpi_ac *ac = NULL; 294 294 295 295 if (!device || !acpi_driver_data(device)) 296 - return -EINVAL; 296 + return; 297 297 298 298 ac = acpi_driver_data(device); 299 299 ··· 301 301 unregister_acpi_notifier(&ac->battery_nb); 302 302 303 303 kfree(ac); 304 - 305 - return 0; 306 304 } 307 305 308 306 static int __init acpi_ac_init(void)
+1 -2
drivers/acpi/acpi_pad.c
··· 449 449 return 0; 450 450 } 451 451 452 - static int acpi_pad_remove(struct acpi_device *device) 452 + static void acpi_pad_remove(struct acpi_device *device) 453 453 { 454 454 mutex_lock(&isolated_cpus_lock); 455 455 acpi_pad_idle_cpus(0); ··· 458 458 acpi_remove_notify_handler(device->handle, 459 459 ACPI_DEVICE_NOTIFY, acpi_pad_notify); 460 460 acpi_pad_remove_sysfs(device); 461 - return 0; 462 461 } 463 462 464 463 static const struct acpi_device_id pad_device_ids[] = {
+3 -5
drivers/acpi/acpi_video.c
··· 86 86 static DEFINE_MUTEX(video_list_lock); 87 87 static LIST_HEAD(video_bus_head); 88 88 static int acpi_video_bus_add(struct acpi_device *device); 89 - static int acpi_video_bus_remove(struct acpi_device *device); 89 + static void acpi_video_bus_remove(struct acpi_device *device); 90 90 static void acpi_video_bus_notify(struct acpi_device *device, u32 event); 91 91 static void acpi_video_bus_register_backlight_work(struct work_struct *ignored); 92 92 static DECLARE_DELAYED_WORK(video_bus_register_backlight_work, ··· 2067 2067 return error; 2068 2068 } 2069 2069 2070 - static int acpi_video_bus_remove(struct acpi_device *device) 2070 + static void acpi_video_bus_remove(struct acpi_device *device) 2071 2071 { 2072 2072 struct acpi_video_bus *video = NULL; 2073 2073 2074 2074 2075 2075 if (!device || !acpi_driver_data(device)) 2076 - return -EINVAL; 2076 + return; 2077 2077 2078 2078 video = acpi_driver_data(device); 2079 2079 ··· 2087 2087 2088 2088 kfree(video->attached_array); 2089 2089 kfree(video); 2090 - 2091 - return 0; 2092 2090 } 2093 2091 2094 2092 static void acpi_video_bus_register_backlight_work(struct work_struct *ignored)
+2 -3
drivers/acpi/battery.c
··· 1208 1208 return result; 1209 1209 } 1210 1210 1211 - static int acpi_battery_remove(struct acpi_device *device) 1211 + static void acpi_battery_remove(struct acpi_device *device) 1212 1212 { 1213 1213 struct acpi_battery *battery = NULL; 1214 1214 1215 1215 if (!device || !acpi_driver_data(device)) 1216 - return -EINVAL; 1216 + return; 1217 1217 device_init_wakeup(&device->dev, 0); 1218 1218 battery = acpi_driver_data(device); 1219 1219 unregister_pm_notifier(&battery->pm_nb); ··· 1221 1221 mutex_destroy(&battery->lock); 1222 1222 mutex_destroy(&battery->sysfs_lock); 1223 1223 kfree(battery); 1224 - return 0; 1225 1224 } 1226 1225 1227 1226 #ifdef CONFIG_PM_SLEEP
+2 -3
drivers/acpi/button.c
··· 125 125 }; 126 126 127 127 static int acpi_button_add(struct acpi_device *device); 128 - static int acpi_button_remove(struct acpi_device *device); 128 + static void acpi_button_remove(struct acpi_device *device); 129 129 static void acpi_button_notify(struct acpi_device *device, u32 event); 130 130 131 131 #ifdef CONFIG_PM_SLEEP ··· 580 580 return error; 581 581 } 582 582 583 - static int acpi_button_remove(struct acpi_device *device) 583 + static void acpi_button_remove(struct acpi_device *device) 584 584 { 585 585 struct acpi_button *button = acpi_driver_data(device); 586 586 587 587 acpi_button_remove_fs(device); 588 588 input_unregister_device(button->input); 589 589 kfree(button); 590 - return 0; 591 590 } 592 591 593 592 static int param_set_lid_init_state(const char *val,
+2 -3
drivers/acpi/ec.c
··· 1663 1663 return ret; 1664 1664 } 1665 1665 1666 - static int acpi_ec_remove(struct acpi_device *device) 1666 + static void acpi_ec_remove(struct acpi_device *device) 1667 1667 { 1668 1668 struct acpi_ec *ec; 1669 1669 1670 1670 if (!device) 1671 - return -EINVAL; 1671 + return; 1672 1672 1673 1673 ec = acpi_driver_data(device); 1674 1674 release_region(ec->data_addr, 1); ··· 1678 1678 ec_remove_handlers(ec); 1679 1679 acpi_ec_free(ec); 1680 1680 } 1681 - return 0; 1682 1681 } 1683 1682 1684 1683 static acpi_status
+1 -2
drivers/acpi/hed.c
··· 56 56 return 0; 57 57 } 58 58 59 - static int acpi_hed_remove(struct acpi_device *device) 59 + static void acpi_hed_remove(struct acpi_device *device) 60 60 { 61 61 hed_handle = NULL; 62 - return 0; 63 62 } 64 63 65 64 static struct acpi_driver acpi_hed_driver = {
+1 -2
drivers/acpi/nfit/core.c
··· 3371 3371 return devm_add_action_or_reset(dev, acpi_nfit_shutdown, acpi_desc); 3372 3372 } 3373 3373 3374 - static int acpi_nfit_remove(struct acpi_device *adev) 3374 + static void acpi_nfit_remove(struct acpi_device *adev) 3375 3375 { 3376 3376 /* see acpi_nfit_unregister */ 3377 - return 0; 3378 3377 } 3379 3378 3380 3379 static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle)
+4 -5
drivers/acpi/sbs.c
··· 96 96 97 97 #define to_acpi_sbs(x) power_supply_get_drvdata(x) 98 98 99 - static int acpi_sbs_remove(struct acpi_device *device); 99 + static void acpi_sbs_remove(struct acpi_device *device); 100 100 static int acpi_battery_get_state(struct acpi_battery *battery); 101 101 102 102 static inline int battery_scale(int log) ··· 664 664 return result; 665 665 } 666 666 667 - static int acpi_sbs_remove(struct acpi_device *device) 667 + static void acpi_sbs_remove(struct acpi_device *device) 668 668 { 669 669 struct acpi_sbs *sbs; 670 670 int id; 671 671 672 672 if (!device) 673 - return -EINVAL; 673 + return; 674 674 sbs = acpi_driver_data(device); 675 675 if (!sbs) 676 - return -EINVAL; 676 + return; 677 677 mutex_lock(&sbs->lock); 678 678 acpi_smbus_unregister_callback(sbs->hc); 679 679 for (id = 0; id < MAX_SBS_BAT; ++id) ··· 682 682 mutex_unlock(&sbs->lock); 683 683 mutex_destroy(&sbs->lock); 684 684 kfree(sbs); 685 - return 0; 686 685 } 687 686 688 687 #ifdef CONFIG_PM_SLEEP
+3 -4
drivers/acpi/sbshc.c
··· 30 30 }; 31 31 32 32 static int acpi_smbus_hc_add(struct acpi_device *device); 33 - static int acpi_smbus_hc_remove(struct acpi_device *device); 33 + static void acpi_smbus_hc_remove(struct acpi_device *device); 34 34 35 35 static const struct acpi_device_id sbs_device_ids[] = { 36 36 {"ACPI0001", 0}, ··· 280 280 281 281 extern void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit); 282 282 283 - static int acpi_smbus_hc_remove(struct acpi_device *device) 283 + static void acpi_smbus_hc_remove(struct acpi_device *device) 284 284 { 285 285 struct acpi_smb_hc *hc; 286 286 287 287 if (!device) 288 - return -EINVAL; 288 + return; 289 289 290 290 hc = acpi_driver_data(device); 291 291 acpi_ec_remove_query_handler(hc->ec, hc->query_bit); 292 292 acpi_os_wait_events_complete(); 293 293 kfree(hc); 294 294 device->driver_data = NULL; 295 - return 0; 296 295 } 297 296 298 297 module_acpi_driver(acpi_smb_hc_driver);
+3 -4
drivers/acpi/thermal.c
··· 74 74 static struct workqueue_struct *acpi_thermal_pm_queue; 75 75 76 76 static int acpi_thermal_add(struct acpi_device *device); 77 - static int acpi_thermal_remove(struct acpi_device *device); 77 + static void acpi_thermal_remove(struct acpi_device *device); 78 78 static void acpi_thermal_notify(struct acpi_device *device, u32 event); 79 79 80 80 static const struct acpi_device_id thermal_device_ids[] = { ··· 1059 1059 return result; 1060 1060 } 1061 1061 1062 - static int acpi_thermal_remove(struct acpi_device *device) 1062 + static void acpi_thermal_remove(struct acpi_device *device) 1063 1063 { 1064 1064 struct acpi_thermal *tz; 1065 1065 1066 1066 if (!device || !acpi_driver_data(device)) 1067 - return -EINVAL; 1067 + return; 1068 1068 1069 1069 flush_workqueue(acpi_thermal_pm_queue); 1070 1070 tz = acpi_driver_data(device); 1071 1071 1072 1072 acpi_thermal_unregister_thermal_zone(tz); 1073 1073 kfree(tz); 1074 - return 0; 1075 1074 } 1076 1075 1077 1076 #ifdef CONFIG_PM_SLEEP
+7 -3
drivers/acpi/tiny-power-button.c
··· 19 19 }; 20 20 MODULE_DEVICE_TABLE(acpi, tiny_power_button_device_ids); 21 21 22 - static int acpi_noop_add_remove(struct acpi_device *device) 22 + static int acpi_noop_add(struct acpi_device *device) 23 23 { 24 24 return 0; 25 + } 26 + 27 + static void acpi_noop_remove(struct acpi_device *device) 28 + { 25 29 } 26 30 27 31 static void acpi_tiny_power_button_notify(struct acpi_device *device, u32 event) ··· 38 34 .class = "tiny-power-button", 39 35 .ids = tiny_power_button_device_ids, 40 36 .ops = { 41 - .add = acpi_noop_add_remove, 42 - .remove = acpi_noop_add_remove, 37 + .add = acpi_noop_add, 38 + .remove = acpi_noop_remove, 43 39 .notify = acpi_tiny_power_button_notify, 44 40 }, 45 41 };
+1 -2
drivers/char/sonypi.c
··· 1123 1123 return 0; 1124 1124 } 1125 1125 1126 - static int sonypi_acpi_remove(struct acpi_device *device) 1126 + static void sonypi_acpi_remove(struct acpi_device *device) 1127 1127 { 1128 1128 sonypi_acpi_device = NULL; 1129 - return 0; 1130 1129 } 1131 1130 1132 1131 static const struct acpi_device_id sonypi_device_ids[] = {
+1 -3
drivers/char/tpm/tpm_crb.c
··· 713 713 return tpm_chip_register(chip); 714 714 } 715 715 716 - static int crb_acpi_remove(struct acpi_device *device) 716 + static void crb_acpi_remove(struct acpi_device *device) 717 717 { 718 718 struct device *dev = &device->dev; 719 719 struct tpm_chip *chip = dev_get_drvdata(dev); 720 720 721 721 tpm_chip_unregister(chip); 722 - 723 - return 0; 724 722 } 725 723 726 724 static const struct dev_pm_ops crb_pm = {
+1 -3
drivers/hv/vmbus_drv.c
··· 2239 2239 return AE_OK; 2240 2240 } 2241 2241 2242 - static int vmbus_acpi_remove(struct acpi_device *device) 2242 + static void vmbus_acpi_remove(struct acpi_device *device) 2243 2243 { 2244 2244 struct resource *cur_res; 2245 2245 struct resource *next_res; ··· 2256 2256 kfree(cur_res); 2257 2257 } 2258 2258 } 2259 - 2260 - return 0; 2261 2259 } 2262 2260 2263 2261 static void vmbus_reserve_fb(void)
+2 -3
drivers/hwmon/acpi_power_meter.c
··· 910 910 return res; 911 911 } 912 912 913 - static int acpi_power_meter_remove(struct acpi_device *device) 913 + static void acpi_power_meter_remove(struct acpi_device *device) 914 914 { 915 915 struct acpi_power_meter_resource *resource; 916 916 917 917 if (!device || !acpi_driver_data(device)) 918 - return -EINVAL; 918 + return; 919 919 920 920 resource = acpi_driver_data(device); 921 921 hwmon_device_unregister(resource->hwmon_dev); ··· 924 924 free_capabilities(resource); 925 925 926 926 kfree(resource); 927 - return 0; 928 927 } 929 928 930 929 static int acpi_power_meter_resume(struct device *dev)
+2 -4
drivers/hwmon/asus_atk0110.c
··· 187 187 }; 188 188 189 189 static int atk_add(struct acpi_device *device); 190 - static int atk_remove(struct acpi_device *device); 190 + static void atk_remove(struct acpi_device *device); 191 191 static void atk_print_sensor(struct atk_data *data, union acpi_object *obj); 192 192 static int atk_read_value(struct atk_sensor_data *sensor, u64 *value); 193 193 ··· 1344 1344 return err; 1345 1345 } 1346 1346 1347 - static int atk_remove(struct acpi_device *device) 1347 + static void atk_remove(struct acpi_device *device) 1348 1348 { 1349 1349 struct atk_data *data = device->driver_data; 1350 1350 dev_dbg(&device->dev, "removing...\n"); ··· 1359 1359 if (atk_ec_ctl(data, 0)) 1360 1360 dev_err(&device->dev, "Failed to disable EC\n"); 1361 1361 } 1362 - 1363 - return 0; 1364 1362 } 1365 1363 1366 1364 static int __init atk0110_init(void)
+1 -3
drivers/input/misc/atlas_btns.c
··· 106 106 return err; 107 107 } 108 108 109 - static int atlas_acpi_button_remove(struct acpi_device *device) 109 + static void atlas_acpi_button_remove(struct acpi_device *device) 110 110 { 111 111 acpi_status status; 112 112 ··· 116 116 pr_err("error removing addr spc handler\n"); 117 117 118 118 input_unregister_device(input_dev); 119 - 120 - return 0; 121 119 } 122 120 123 121 static const struct acpi_device_id atlas_device_ids[] = {
+1 -3
drivers/net/fjes/fjes_main.c
··· 145 145 return 0; 146 146 } 147 147 148 - static int fjes_acpi_remove(struct acpi_device *device) 148 + static void fjes_acpi_remove(struct acpi_device *device) 149 149 { 150 150 struct platform_device *plat_dev; 151 151 152 152 plat_dev = (struct platform_device *)acpi_driver_data(device); 153 153 platform_device_unregister(plat_dev); 154 - 155 - return 0; 156 154 } 157 155 158 156 static struct acpi_driver fjes_acpi_driver = {
+1 -2
drivers/platform/chrome/chromeos_privacy_screen.c
··· 123 123 return 0; 124 124 } 125 125 126 - static int chromeos_privacy_screen_remove(struct acpi_device *adev) 126 + static void chromeos_privacy_screen_remove(struct acpi_device *adev) 127 127 { 128 128 struct drm_privacy_screen *drm_privacy_screen = acpi_driver_data(adev); 129 129 130 130 drm_privacy_screen_unregister(drm_privacy_screen); 131 - return 0; 132 131 } 133 132 134 133 static const struct acpi_device_id chromeos_privacy_screen_device_ids[] = {
+1 -3
drivers/platform/chrome/wilco_ec/event.c
··· 500 500 return error; 501 501 } 502 502 503 - static int event_device_remove(struct acpi_device *adev) 503 + static void event_device_remove(struct acpi_device *adev) 504 504 { 505 505 struct event_device_data *dev_data = adev->driver_data; 506 506 507 507 cdev_device_del(&dev_data->cdev, &dev_data->dev); 508 508 ida_simple_remove(&event_ida, MINOR(dev_data->dev.devt)); 509 509 hangup_device(dev_data); 510 - 511 - return 0; 512 510 } 513 511 514 512 static const struct acpi_device_id event_acpi_ids[] = {
+1 -2
drivers/platform/surface/surfacepro3_button.c
··· 239 239 return error; 240 240 } 241 241 242 - static int surface_button_remove(struct acpi_device *device) 242 + static void surface_button_remove(struct acpi_device *device) 243 243 { 244 244 struct surface_button *button = acpi_driver_data(device); 245 245 246 246 input_unregister_device(button->input); 247 247 kfree(button); 248 - return 0; 249 248 } 250 249 251 250 static SIMPLE_DEV_PM_OPS(surface_button_pm,
+1 -2
drivers/platform/x86/asus-laptop.c
··· 1901 1901 return result; 1902 1902 } 1903 1903 1904 - static int asus_acpi_remove(struct acpi_device *device) 1904 + static void asus_acpi_remove(struct acpi_device *device) 1905 1905 { 1906 1906 struct asus_laptop *asus = acpi_driver_data(device); 1907 1907 ··· 1914 1914 1915 1915 kfree(asus->name); 1916 1916 kfree(asus); 1917 - return 0; 1918 1917 } 1919 1918 1920 1919 static const struct acpi_device_id asus_device_ids[] = {
+1 -2
drivers/platform/x86/asus-wireless.c
··· 175 175 return err; 176 176 } 177 177 178 - static int asus_wireless_remove(struct acpi_device *adev) 178 + static void asus_wireless_remove(struct acpi_device *adev) 179 179 { 180 180 struct asus_wireless_data *data = acpi_driver_data(adev); 181 181 ··· 183 183 devm_led_classdev_unregister(&adev->dev, &data->led); 184 184 destroy_workqueue(data->wq); 185 185 } 186 - return 0; 187 186 } 188 187 189 188 static struct acpi_driver asus_wireless_driver = {
+9 -11
drivers/platform/x86/classmate-laptop.c
··· 418 418 return error; 419 419 } 420 420 421 - static int cmpc_accel_remove_v4(struct acpi_device *acpi) 421 + static void cmpc_accel_remove_v4(struct acpi_device *acpi) 422 422 { 423 423 device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr_v4); 424 424 device_remove_file(&acpi->dev, &cmpc_accel_g_select_attr_v4); 425 - return cmpc_remove_acpi_notify_device(acpi); 425 + cmpc_remove_acpi_notify_device(acpi); 426 426 } 427 427 428 428 static SIMPLE_DEV_PM_OPS(cmpc_accel_pm, cmpc_accel_suspend_v4, ··· 648 648 return error; 649 649 } 650 650 651 - static int cmpc_accel_remove(struct acpi_device *acpi) 651 + static void cmpc_accel_remove(struct acpi_device *acpi) 652 652 { 653 653 device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr); 654 - return cmpc_remove_acpi_notify_device(acpi); 654 + cmpc_remove_acpi_notify_device(acpi); 655 655 } 656 656 657 657 static const struct acpi_device_id cmpc_accel_device_ids[] = { ··· 727 727 cmpc_tablet_idev_init); 728 728 } 729 729 730 - static int cmpc_tablet_remove(struct acpi_device *acpi) 730 + static void cmpc_tablet_remove(struct acpi_device *acpi) 731 731 { 732 - return cmpc_remove_acpi_notify_device(acpi); 732 + cmpc_remove_acpi_notify_device(acpi); 733 733 } 734 734 735 735 #ifdef CONFIG_PM_SLEEP ··· 974 974 return retval; 975 975 } 976 976 977 - static int cmpc_ipml_remove(struct acpi_device *acpi) 977 + static void cmpc_ipml_remove(struct acpi_device *acpi) 978 978 { 979 979 struct ipml200_dev *ipml; 980 980 ··· 988 988 } 989 989 990 990 kfree(ipml); 991 - 992 - return 0; 993 991 } 994 992 995 993 static const struct acpi_device_id cmpc_ipml_device_ids[] = { ··· 1053 1055 cmpc_keys_idev_init); 1054 1056 } 1055 1057 1056 - static int cmpc_keys_remove(struct acpi_device *acpi) 1058 + static void cmpc_keys_remove(struct acpi_device *acpi) 1057 1059 { 1058 - return cmpc_remove_acpi_notify_device(acpi); 1060 + cmpc_remove_acpi_notify_device(acpi); 1059 1061 } 1060 1062 1061 1063 static const struct acpi_device_id cmpc_keys_device_ids[] = {
+2 -4
drivers/platform/x86/dell/dell-rbtn.c
··· 206 206 */ 207 207 208 208 static int rbtn_add(struct acpi_device *device); 209 - static int rbtn_remove(struct acpi_device *device); 209 + static void rbtn_remove(struct acpi_device *device); 210 210 static void rbtn_notify(struct acpi_device *device, u32 event); 211 211 212 212 static const struct acpi_device_id rbtn_ids[] = { ··· 426 426 427 427 } 428 428 429 - static int rbtn_remove(struct acpi_device *device) 429 + static void rbtn_remove(struct acpi_device *device) 430 430 { 431 431 struct rbtn_data *rbtn_data = device->driver_data; 432 432 ··· 443 443 444 444 rbtn_acquire(device, false); 445 445 device->driver_data = NULL; 446 - 447 - return 0; 448 446 } 449 447 450 448 static void rbtn_notify(struct acpi_device *device, u32 event)
+1 -2
drivers/platform/x86/eeepc-laptop.c
··· 1440 1440 return result; 1441 1441 } 1442 1442 1443 - static int eeepc_acpi_remove(struct acpi_device *device) 1443 + static void eeepc_acpi_remove(struct acpi_device *device) 1444 1444 { 1445 1445 struct eeepc_laptop *eeepc = acpi_driver_data(device); 1446 1446 ··· 1451 1451 eeepc_platform_exit(eeepc); 1452 1452 1453 1453 kfree(eeepc); 1454 - return 0; 1455 1454 } 1456 1455 1457 1456
+1 -3
drivers/platform/x86/fujitsu-laptop.c
··· 847 847 return ret; 848 848 } 849 849 850 - static int acpi_fujitsu_laptop_remove(struct acpi_device *device) 850 + static void acpi_fujitsu_laptop_remove(struct acpi_device *device) 851 851 { 852 852 struct fujitsu_laptop *priv = acpi_driver_data(device); 853 853 854 854 fujitsu_laptop_platform_remove(device); 855 855 856 856 kfifo_free(&priv->fifo); 857 - 858 - return 0; 859 857 } 860 858 861 859 static void acpi_fujitsu_laptop_press(struct acpi_device *device, int scancode)
+1 -2
drivers/platform/x86/fujitsu-tablet.c
··· 484 484 return 0; 485 485 } 486 486 487 - static int acpi_fujitsu_remove(struct acpi_device *adev) 487 + static void acpi_fujitsu_remove(struct acpi_device *adev) 488 488 { 489 489 free_irq(fujitsu.irq, fujitsu_interrupt); 490 490 release_region(fujitsu.io_base, fujitsu.io_length); 491 491 input_fujitsu_remove(); 492 - return 0; 493 492 } 494 493 495 494 #ifdef CONFIG_PM_SLEEP
+1 -3
drivers/platform/x86/intel/rst.c
··· 113 113 return error; 114 114 } 115 115 116 - static int irst_remove(struct acpi_device *acpi) 116 + static void irst_remove(struct acpi_device *acpi) 117 117 { 118 118 device_remove_file(&acpi->dev, &irst_wakeup_attr); 119 119 device_remove_file(&acpi->dev, &irst_timeout_attr); 120 - 121 - return 0; 122 120 } 123 121 124 122 static const struct acpi_device_id irst_ids[] = {
+1 -3
drivers/platform/x86/lg-laptop.c
··· 761 761 return ret; 762 762 } 763 763 764 - static int acpi_remove(struct acpi_device *device) 764 + static void acpi_remove(struct acpi_device *device) 765 765 { 766 766 sysfs_remove_group(&pf_device->dev.kobj, &dev_attribute_group); 767 767 ··· 773 773 platform_device_unregister(pf_device); 774 774 pf_device = NULL; 775 775 platform_driver_unregister(&pf_driver); 776 - 777 - return 0; 778 776 } 779 777 780 778 static const struct acpi_device_id device_ids[] = {
+3 -5
drivers/platform/x86/panasonic-laptop.c
··· 183 183 /* R1 handles SINF_AC_CUR_BRIGHT as SINF_CUR_BRIGHT, doesn't know AC state */ 184 184 185 185 static int acpi_pcc_hotkey_add(struct acpi_device *device); 186 - static int acpi_pcc_hotkey_remove(struct acpi_device *device); 186 + static void acpi_pcc_hotkey_remove(struct acpi_device *device); 187 187 static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event); 188 188 189 189 static const struct acpi_device_id pcc_device_ids[] = { ··· 1065 1065 return result; 1066 1066 } 1067 1067 1068 - static int acpi_pcc_hotkey_remove(struct acpi_device *device) 1068 + static void acpi_pcc_hotkey_remove(struct acpi_device *device) 1069 1069 { 1070 1070 struct pcc_acpi *pcc = acpi_driver_data(device); 1071 1071 1072 1072 if (!device || !pcc) 1073 - return -EINVAL; 1073 + return; 1074 1074 1075 1075 i8042_remove_filter(panasonic_i8042_filter); 1076 1076 ··· 1088 1088 1089 1089 kfree(pcc->sinf); 1090 1090 kfree(pcc); 1091 - 1092 - return 0; 1093 1091 } 1094 1092 1095 1093 module_acpi_driver(acpi_pcc_driver);
+3 -6
drivers/platform/x86/sony-laptop.c
··· 3263 3263 return result; 3264 3264 } 3265 3265 3266 - static int sony_nc_remove(struct acpi_device *device) 3266 + static void sony_nc_remove(struct acpi_device *device) 3267 3267 { 3268 3268 struct sony_nc_value *item; 3269 3269 ··· 3280 3280 sony_pf_remove(); 3281 3281 sony_laptop_remove_input(); 3282 3282 dprintk(SONY_NC_DRIVER_NAME " removed.\n"); 3283 - 3284 - return 0; 3285 3283 } 3286 3284 3287 3285 static const struct acpi_device_id sony_device_ids[] = { ··· 4628 4630 * ACPI driver 4629 4631 * 4630 4632 *****************/ 4631 - static int sony_pic_remove(struct acpi_device *device) 4633 + static void sony_pic_remove(struct acpi_device *device) 4632 4634 { 4633 4635 struct sony_pic_ioport *io, *tmp_io; 4634 4636 struct sony_pic_irq *irq, *tmp_irq; 4635 4637 4636 4638 if (sony_pic_disable(device)) { 4637 4639 pr_err("Couldn't disable device\n"); 4638 - return -ENXIO; 4640 + return; 4639 4641 } 4640 4642 4641 4643 free_irq(spic_dev.cur_irq->irq.interrupts[0], &spic_dev); ··· 4665 4667 spic_dev.cur_irq = NULL; 4666 4668 4667 4669 dprintk(SONY_PIC_DRIVER_NAME " removed.\n"); 4668 - return 0; 4669 4670 } 4670 4671 4671 4672 static int sony_pic_add(struct acpi_device *device)
+1 -3
drivers/platform/x86/system76_acpi.c
··· 744 744 } 745 745 746 746 // Remove a System76 ACPI device 747 - static int system76_remove(struct acpi_device *acpi_dev) 747 + static void system76_remove(struct acpi_device *acpi_dev) 748 748 { 749 749 struct system76_data *data; 750 750 ··· 760 760 devm_led_classdev_unregister(&acpi_dev->dev, &data->kb_led); 761 761 762 762 system76_get(data, "FINI"); 763 - 764 - return 0; 765 763 } 766 764 767 765 static struct acpi_driver system76_driver = {
+1 -2
drivers/platform/x86/topstar-laptop.c
··· 332 332 return err; 333 333 } 334 334 335 - static int topstar_acpi_remove(struct acpi_device *device) 335 + static void topstar_acpi_remove(struct acpi_device *device) 336 336 { 337 337 struct topstar_laptop *topstar = acpi_driver_data(device); 338 338 ··· 344 344 topstar_acpi_exit(topstar); 345 345 346 346 kfree(topstar); 347 - return 0; 348 347 } 349 348 350 349 static const struct acpi_device_id topstar_device_ids[] = {
+1 -3
drivers/platform/x86/toshiba_acpi.c
··· 3186 3186 pr_cont("\n"); 3187 3187 } 3188 3188 3189 - static int toshiba_acpi_remove(struct acpi_device *acpi_dev) 3189 + static void toshiba_acpi_remove(struct acpi_device *acpi_dev) 3190 3190 { 3191 3191 struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev); 3192 3192 ··· 3234 3234 toshiba_acpi = NULL; 3235 3235 3236 3236 kfree(dev); 3237 - 3238 - return 0; 3239 3237 } 3240 3238 3241 3239 static const char *find_hci_method(acpi_handle handle)
+3 -3
drivers/platform/x86/toshiba_bluetooth.c
··· 36 36 }; 37 37 38 38 static int toshiba_bt_rfkill_add(struct acpi_device *device); 39 - static int toshiba_bt_rfkill_remove(struct acpi_device *device); 39 + static void toshiba_bt_rfkill_remove(struct acpi_device *device); 40 40 static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event); 41 41 42 42 static const struct acpi_device_id bt_device_ids[] = { ··· 279 279 return result; 280 280 } 281 281 282 - static int toshiba_bt_rfkill_remove(struct acpi_device *device) 282 + static void toshiba_bt_rfkill_remove(struct acpi_device *device) 283 283 { 284 284 struct toshiba_bluetooth_dev *bt_dev = acpi_driver_data(device); 285 285 ··· 291 291 292 292 kfree(bt_dev); 293 293 294 - return toshiba_bluetooth_disable(device->handle); 294 + toshiba_bluetooth_disable(device->handle); 295 295 } 296 296 297 297 module_acpi_driver(toshiba_bt_rfkill_driver);
+1 -3
drivers/platform/x86/toshiba_haps.c
··· 138 138 event, 0); 139 139 } 140 140 141 - static int toshiba_haps_remove(struct acpi_device *device) 141 + static void toshiba_haps_remove(struct acpi_device *device) 142 142 { 143 143 sysfs_remove_group(&device->dev.kobj, &haps_attr_group); 144 144 145 145 if (toshiba_haps) 146 146 toshiba_haps = NULL; 147 - 148 - return 0; 149 147 } 150 148 151 149 /* Helper function */
+1 -2
drivers/platform/x86/wireless-hotkey.c
··· 83 83 return err; 84 84 } 85 85 86 - static int wl_remove(struct acpi_device *device) 86 + static void wl_remove(struct acpi_device *device) 87 87 { 88 88 wireless_input_destroy(); 89 - return 0; 90 89 } 91 90 92 91 static struct acpi_driver wl_driver = {
+1 -2
drivers/platform/x86/xo15-ebook.c
··· 143 143 return error; 144 144 } 145 145 146 - static int ebook_switch_remove(struct acpi_device *device) 146 + static void ebook_switch_remove(struct acpi_device *device) 147 147 { 148 148 struct ebook_switch *button = acpi_driver_data(device); 149 149 150 150 input_unregister_device(button->input); 151 151 kfree(button); 152 - return 0; 153 152 } 154 153 155 154 static struct acpi_driver xo15_ebook_driver = {
+1 -2
drivers/ptp/ptp_vmw.c
··· 101 101 return 0; 102 102 } 103 103 104 - static int ptp_vmw_acpi_remove(struct acpi_device *device) 104 + static void ptp_vmw_acpi_remove(struct acpi_device *device) 105 105 { 106 106 ptp_clock_unregister(ptp_vmw_clock); 107 - return 0; 108 107 } 109 108 110 109 static const struct acpi_device_id ptp_vmw_acpi_device_ids[] = {
+3 -5
drivers/thermal/intel/intel_menlow.c
··· 179 179 180 180 } 181 181 182 - static int intel_menlow_memory_remove(struct acpi_device *device) 182 + static void intel_menlow_memory_remove(struct acpi_device *device) 183 183 { 184 184 struct thermal_cooling_device *cdev; 185 185 186 186 if (!device) 187 - return -EINVAL; 187 + return; 188 188 189 189 cdev = acpi_driver_data(device); 190 190 if (!cdev) 191 - return -EINVAL; 191 + return; 192 192 193 193 sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); 194 194 sysfs_remove_link(&cdev->device.kobj, "device"); 195 195 thermal_cooling_device_unregister(cdev); 196 - 197 - return 0; 198 196 } 199 197 200 198 static const struct acpi_device_id intel_menlow_memory_ids[] = {
+1 -2
drivers/video/backlight/apple_bl.c
··· 193 193 return 0; 194 194 } 195 195 196 - static int apple_bl_remove(struct acpi_device *dev) 196 + static void apple_bl_remove(struct acpi_device *dev) 197 197 { 198 198 backlight_device_unregister(apple_backlight_device); 199 199 200 200 release_region(hw_data->iostart, hw_data->iolen); 201 201 hw_data = NULL; 202 - return 0; 203 202 } 204 203 205 204 static const struct acpi_device_id apple_bl_ids[] = {
+1 -3
drivers/watchdog/ni903x_wdt.c
··· 224 224 return 0; 225 225 } 226 226 227 - static int ni903x_acpi_remove(struct acpi_device *device) 227 + static void ni903x_acpi_remove(struct acpi_device *device) 228 228 { 229 229 struct ni903x_wdt *wdt = acpi_driver_data(device); 230 230 231 231 ni903x_wdd_stop(&wdt->wdd); 232 232 watchdog_unregister_device(&wdt->wdd); 233 - 234 - return 0; 235 233 } 236 234 237 235 static const struct acpi_device_id ni903x_device_ids[] = {
+1 -2
drivers/xen/xen-acpi-pad.c
··· 122 122 return 0; 123 123 } 124 124 125 - static int acpi_pad_remove(struct acpi_device *device) 125 + static void acpi_pad_remove(struct acpi_device *device) 126 126 { 127 127 mutex_lock(&xen_cpu_lock); 128 128 xen_acpi_pad_idle_cpus(0); ··· 130 130 131 131 acpi_remove_notify_handler(device->handle, 132 132 ACPI_DEVICE_NOTIFY, acpi_pad_notify); 133 - return 0; 134 133 } 135 134 136 135 static const struct acpi_device_id pad_device_ids[] = {
+1 -1
include/acpi/acpi_bus.h
··· 149 149 */ 150 150 151 151 typedef int (*acpi_op_add) (struct acpi_device * device); 152 - typedef int (*acpi_op_remove) (struct acpi_device * device); 152 + typedef void (*acpi_op_remove) (struct acpi_device *device); 153 153 typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); 154 154 155 155 struct acpi_device_ops {