mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-23 18:14:04 +08:00
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 fc7a6209d5
("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>
This commit is contained in:
parent
d7d4332155
commit
6c0eb5ba35
@ -187,9 +187,9 @@ static int aml_nfw_add(struct acpi_device *device)
|
||||
return aml_nfw_add_global_handler();
|
||||
}
|
||||
|
||||
static int aml_nfw_remove(struct acpi_device *device)
|
||||
static void aml_nfw_remove(struct acpi_device *device)
|
||||
{
|
||||
return aml_nfw_remove_global_handler();
|
||||
aml_nfw_remove_global_handler();
|
||||
}
|
||||
|
||||
static const struct acpi_device_id aml_nfw_ids[] = {
|
||||
|
@ -183,13 +183,12 @@ err_sysfs:
|
||||
return r;
|
||||
}
|
||||
|
||||
static int xo15_sci_remove(struct acpi_device *device)
|
||||
static void xo15_sci_remove(struct acpi_device *device)
|
||||
{
|
||||
acpi_disable_gpe(NULL, xo15_sci_gpe);
|
||||
acpi_remove_gpe_handler(NULL, xo15_sci_gpe, xo15_sci_gpe_handler);
|
||||
cancel_work_sync(&sci_work);
|
||||
sysfs_remove_file(&device->dev.kobj, &lid_wake_on_close_attr.attr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -33,7 +33,7 @@ MODULE_DESCRIPTION("ACPI AC Adapter Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static int acpi_ac_add(struct acpi_device *device);
|
||||
static int acpi_ac_remove(struct acpi_device *device);
|
||||
static void acpi_ac_remove(struct acpi_device *device);
|
||||
static void acpi_ac_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id ac_device_ids[] = {
|
||||
@ -288,12 +288,12 @@ static int acpi_ac_resume(struct device *dev)
|
||||
#define acpi_ac_resume NULL
|
||||
#endif
|
||||
|
||||
static int acpi_ac_remove(struct acpi_device *device)
|
||||
static void acpi_ac_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_ac *ac = NULL;
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
ac = acpi_driver_data(device);
|
||||
|
||||
@ -301,8 +301,6 @@ static int acpi_ac_remove(struct acpi_device *device)
|
||||
unregister_acpi_notifier(&ac->battery_nb);
|
||||
|
||||
kfree(ac);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init acpi_ac_init(void)
|
||||
|
@ -449,7 +449,7 @@ static int acpi_pad_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_pad_remove(struct acpi_device *device)
|
||||
static void acpi_pad_remove(struct acpi_device *device)
|
||||
{
|
||||
mutex_lock(&isolated_cpus_lock);
|
||||
acpi_pad_idle_cpus(0);
|
||||
@ -458,7 +458,6 @@ static int acpi_pad_remove(struct acpi_device *device)
|
||||
acpi_remove_notify_handler(device->handle,
|
||||
ACPI_DEVICE_NOTIFY, acpi_pad_notify);
|
||||
acpi_pad_remove_sysfs(device);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id pad_device_ids[] = {
|
||||
|
@ -86,7 +86,7 @@ static DEFINE_MUTEX(register_count_mutex);
|
||||
static DEFINE_MUTEX(video_list_lock);
|
||||
static LIST_HEAD(video_bus_head);
|
||||
static int acpi_video_bus_add(struct acpi_device *device);
|
||||
static int acpi_video_bus_remove(struct acpi_device *device);
|
||||
static void acpi_video_bus_remove(struct acpi_device *device);
|
||||
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
|
||||
static void acpi_video_bus_register_backlight_work(struct work_struct *ignored);
|
||||
static DECLARE_DELAYED_WORK(video_bus_register_backlight_work,
|
||||
@ -2067,13 +2067,13 @@ err_free_video:
|
||||
return error;
|
||||
}
|
||||
|
||||
static int acpi_video_bus_remove(struct acpi_device *device)
|
||||
static void acpi_video_bus_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_video_bus *video = NULL;
|
||||
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
video = acpi_driver_data(device);
|
||||
|
||||
@ -2087,8 +2087,6 @@ static int acpi_video_bus_remove(struct acpi_device *device)
|
||||
|
||||
kfree(video->attached_array);
|
||||
kfree(video);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void acpi_video_bus_register_backlight_work(struct work_struct *ignored)
|
||||
|
@ -1208,12 +1208,12 @@ fail:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_battery_remove(struct acpi_device *device)
|
||||
static void acpi_battery_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_battery *battery = NULL;
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
return;
|
||||
device_init_wakeup(&device->dev, 0);
|
||||
battery = acpi_driver_data(device);
|
||||
unregister_pm_notifier(&battery->pm_nb);
|
||||
@ -1221,7 +1221,6 @@ static int acpi_battery_remove(struct acpi_device *device)
|
||||
mutex_destroy(&battery->lock);
|
||||
mutex_destroy(&battery->sysfs_lock);
|
||||
kfree(battery);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -125,7 +125,7 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
|
||||
};
|
||||
|
||||
static int acpi_button_add(struct acpi_device *device);
|
||||
static int acpi_button_remove(struct acpi_device *device);
|
||||
static void acpi_button_remove(struct acpi_device *device);
|
||||
static void acpi_button_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@ -580,14 +580,13 @@ static int acpi_button_add(struct acpi_device *device)
|
||||
return error;
|
||||
}
|
||||
|
||||
static int acpi_button_remove(struct acpi_device *device)
|
||||
static void acpi_button_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_button *button = acpi_driver_data(device);
|
||||
|
||||
acpi_button_remove_fs(device);
|
||||
input_unregister_device(button->input);
|
||||
kfree(button);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int param_set_lid_init_state(const char *val,
|
||||
|
@ -1663,12 +1663,12 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int acpi_ec_remove(struct acpi_device *device)
|
||||
static void acpi_ec_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_ec *ec;
|
||||
|
||||
if (!device)
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
ec = acpi_driver_data(device);
|
||||
release_region(ec->data_addr, 1);
|
||||
@ -1678,7 +1678,6 @@ static int acpi_ec_remove(struct acpi_device *device)
|
||||
ec_remove_handlers(ec);
|
||||
acpi_ec_free(ec);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static acpi_status
|
||||
|
@ -56,10 +56,9 @@ static int acpi_hed_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_hed_remove(struct acpi_device *device)
|
||||
static void acpi_hed_remove(struct acpi_device *device)
|
||||
{
|
||||
hed_handle = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct acpi_driver acpi_hed_driver = {
|
||||
|
@ -3371,10 +3371,9 @@ static int acpi_nfit_add(struct acpi_device *adev)
|
||||
return devm_add_action_or_reset(dev, acpi_nfit_shutdown, acpi_desc);
|
||||
}
|
||||
|
||||
static int acpi_nfit_remove(struct acpi_device *adev)
|
||||
static void acpi_nfit_remove(struct acpi_device *adev)
|
||||
{
|
||||
/* see acpi_nfit_unregister */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle)
|
||||
|
@ -96,7 +96,7 @@ struct acpi_sbs {
|
||||
|
||||
#define to_acpi_sbs(x) power_supply_get_drvdata(x)
|
||||
|
||||
static int acpi_sbs_remove(struct acpi_device *device);
|
||||
static void acpi_sbs_remove(struct acpi_device *device);
|
||||
static int acpi_battery_get_state(struct acpi_battery *battery);
|
||||
|
||||
static inline int battery_scale(int log)
|
||||
@ -664,16 +664,16 @@ end:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_sbs_remove(struct acpi_device *device)
|
||||
static void acpi_sbs_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_sbs *sbs;
|
||||
int id;
|
||||
|
||||
if (!device)
|
||||
return -EINVAL;
|
||||
return;
|
||||
sbs = acpi_driver_data(device);
|
||||
if (!sbs)
|
||||
return -EINVAL;
|
||||
return;
|
||||
mutex_lock(&sbs->lock);
|
||||
acpi_smbus_unregister_callback(sbs->hc);
|
||||
for (id = 0; id < MAX_SBS_BAT; ++id)
|
||||
@ -682,7 +682,6 @@ static int acpi_sbs_remove(struct acpi_device *device)
|
||||
mutex_unlock(&sbs->lock);
|
||||
mutex_destroy(&sbs->lock);
|
||||
kfree(sbs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -30,7 +30,7 @@ struct acpi_smb_hc {
|
||||
};
|
||||
|
||||
static int acpi_smbus_hc_add(struct acpi_device *device);
|
||||
static int acpi_smbus_hc_remove(struct acpi_device *device);
|
||||
static void acpi_smbus_hc_remove(struct acpi_device *device);
|
||||
|
||||
static const struct acpi_device_id sbs_device_ids[] = {
|
||||
{"ACPI0001", 0},
|
||||
@ -280,19 +280,18 @@ static int acpi_smbus_hc_add(struct acpi_device *device)
|
||||
|
||||
extern void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
|
||||
|
||||
static int acpi_smbus_hc_remove(struct acpi_device *device)
|
||||
static void acpi_smbus_hc_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_smb_hc *hc;
|
||||
|
||||
if (!device)
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
hc = acpi_driver_data(device);
|
||||
acpi_ec_remove_query_handler(hc->ec, hc->query_bit);
|
||||
acpi_os_wait_events_complete();
|
||||
kfree(hc);
|
||||
device->driver_data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_acpi_driver(acpi_smb_hc_driver);
|
||||
|
@ -74,7 +74,7 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
|
||||
static struct workqueue_struct *acpi_thermal_pm_queue;
|
||||
|
||||
static int acpi_thermal_add(struct acpi_device *device);
|
||||
static int acpi_thermal_remove(struct acpi_device *device);
|
||||
static void acpi_thermal_remove(struct acpi_device *device);
|
||||
static void acpi_thermal_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id thermal_device_ids[] = {
|
||||
@ -1059,19 +1059,18 @@ end:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_thermal_remove(struct acpi_device *device)
|
||||
static void acpi_thermal_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_thermal *tz;
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
flush_workqueue(acpi_thermal_pm_queue);
|
||||
tz = acpi_driver_data(device);
|
||||
|
||||
acpi_thermal_unregister_thermal_zone(tz);
|
||||
kfree(tz);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -19,11 +19,15 @@ static const struct acpi_device_id tiny_power_button_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, tiny_power_button_device_ids);
|
||||
|
||||
static int acpi_noop_add_remove(struct acpi_device *device)
|
||||
static int acpi_noop_add(struct acpi_device *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void acpi_noop_remove(struct acpi_device *device)
|
||||
{
|
||||
}
|
||||
|
||||
static void acpi_tiny_power_button_notify(struct acpi_device *device, u32 event)
|
||||
{
|
||||
kill_cad_pid(power_signal, 1);
|
||||
@ -34,8 +38,8 @@ static struct acpi_driver acpi_tiny_power_button_driver = {
|
||||
.class = "tiny-power-button",
|
||||
.ids = tiny_power_button_device_ids,
|
||||
.ops = {
|
||||
.add = acpi_noop_add_remove,
|
||||
.remove = acpi_noop_add_remove,
|
||||
.add = acpi_noop_add,
|
||||
.remove = acpi_noop_remove,
|
||||
.notify = acpi_tiny_power_button_notify,
|
||||
},
|
||||
};
|
||||
|
@ -1123,10 +1123,9 @@ static int sonypi_acpi_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sonypi_acpi_remove(struct acpi_device *device)
|
||||
static void sonypi_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
sonypi_acpi_device = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id sonypi_device_ids[] = {
|
||||
|
@ -713,14 +713,12 @@ static int crb_acpi_add(struct acpi_device *device)
|
||||
return tpm_chip_register(chip);
|
||||
}
|
||||
|
||||
static int crb_acpi_remove(struct acpi_device *device)
|
||||
static void crb_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct device *dev = &device->dev;
|
||||
struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||
|
||||
tpm_chip_unregister(chip);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops crb_pm = {
|
||||
|
@ -2239,7 +2239,7 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static int vmbus_acpi_remove(struct acpi_device *device)
|
||||
static void vmbus_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct resource *cur_res;
|
||||
struct resource *next_res;
|
||||
@ -2256,8 +2256,6 @@ static int vmbus_acpi_remove(struct acpi_device *device)
|
||||
kfree(cur_res);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vmbus_reserve_fb(void)
|
||||
|
@ -910,12 +910,12 @@ exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
static int acpi_power_meter_remove(struct acpi_device *device)
|
||||
static void acpi_power_meter_remove(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_power_meter_resource *resource;
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
resource = acpi_driver_data(device);
|
||||
hwmon_device_unregister(resource->hwmon_dev);
|
||||
@ -924,7 +924,6 @@ static int acpi_power_meter_remove(struct acpi_device *device)
|
||||
free_capabilities(resource);
|
||||
|
||||
kfree(resource);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_power_meter_resume(struct device *dev)
|
||||
|
@ -187,7 +187,7 @@ struct atk_acpi_input_buf {
|
||||
};
|
||||
|
||||
static int atk_add(struct acpi_device *device);
|
||||
static int atk_remove(struct acpi_device *device);
|
||||
static void atk_remove(struct acpi_device *device);
|
||||
static void atk_print_sensor(struct atk_data *data, union acpi_object *obj);
|
||||
static int atk_read_value(struct atk_sensor_data *sensor, u64 *value);
|
||||
|
||||
@ -1344,7 +1344,7 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int atk_remove(struct acpi_device *device)
|
||||
static void atk_remove(struct acpi_device *device)
|
||||
{
|
||||
struct atk_data *data = device->driver_data;
|
||||
dev_dbg(&device->dev, "removing...\n");
|
||||
@ -1359,8 +1359,6 @@ static int atk_remove(struct acpi_device *device)
|
||||
if (atk_ec_ctl(data, 0))
|
||||
dev_err(&device->dev, "Failed to disable EC\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init atk0110_init(void)
|
||||
|
@ -106,7 +106,7 @@ static int atlas_acpi_button_add(struct acpi_device *device)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int atlas_acpi_button_remove(struct acpi_device *device)
|
||||
static void atlas_acpi_button_remove(struct acpi_device *device)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
@ -116,8 +116,6 @@ static int atlas_acpi_button_remove(struct acpi_device *device)
|
||||
pr_err("error removing addr spc handler\n");
|
||||
|
||||
input_unregister_device(input_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id atlas_device_ids[] = {
|
||||
|
@ -145,14 +145,12 @@ static int fjes_acpi_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fjes_acpi_remove(struct acpi_device *device)
|
||||
static void fjes_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct platform_device *plat_dev;
|
||||
|
||||
plat_dev = (struct platform_device *)acpi_driver_data(device);
|
||||
platform_device_unregister(plat_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct acpi_driver fjes_acpi_driver = {
|
||||
|
@ -123,12 +123,11 @@ static int chromeos_privacy_screen_add(struct acpi_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int chromeos_privacy_screen_remove(struct acpi_device *adev)
|
||||
static void chromeos_privacy_screen_remove(struct acpi_device *adev)
|
||||
{
|
||||
struct drm_privacy_screen *drm_privacy_screen = acpi_driver_data(adev);
|
||||
|
||||
drm_privacy_screen_unregister(drm_privacy_screen);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id chromeos_privacy_screen_device_ids[] = {
|
||||
|
@ -500,15 +500,13 @@ free_minor:
|
||||
return error;
|
||||
}
|
||||
|
||||
static int event_device_remove(struct acpi_device *adev)
|
||||
static void event_device_remove(struct acpi_device *adev)
|
||||
{
|
||||
struct event_device_data *dev_data = adev->driver_data;
|
||||
|
||||
cdev_device_del(&dev_data->cdev, &dev_data->dev);
|
||||
ida_simple_remove(&event_ida, MINOR(dev_data->dev.devt));
|
||||
hangup_device(dev_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id event_acpi_ids[] = {
|
||||
|
@ -239,13 +239,12 @@ static int surface_button_add(struct acpi_device *device)
|
||||
return error;
|
||||
}
|
||||
|
||||
static int surface_button_remove(struct acpi_device *device)
|
||||
static void surface_button_remove(struct acpi_device *device)
|
||||
{
|
||||
struct surface_button *button = acpi_driver_data(device);
|
||||
|
||||
input_unregister_device(button->input);
|
||||
kfree(button);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(surface_button_pm,
|
||||
|
@ -1901,7 +1901,7 @@ fail_platform:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int asus_acpi_remove(struct acpi_device *device)
|
||||
static void asus_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct asus_laptop *asus = acpi_driver_data(device);
|
||||
|
||||
@ -1914,7 +1914,6 @@ static int asus_acpi_remove(struct acpi_device *device)
|
||||
|
||||
kfree(asus->name);
|
||||
kfree(asus);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id asus_device_ids[] = {
|
||||
|
@ -175,7 +175,7 @@ static int asus_wireless_add(struct acpi_device *adev)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int asus_wireless_remove(struct acpi_device *adev)
|
||||
static void asus_wireless_remove(struct acpi_device *adev)
|
||||
{
|
||||
struct asus_wireless_data *data = acpi_driver_data(adev);
|
||||
|
||||
@ -183,7 +183,6 @@ static int asus_wireless_remove(struct acpi_device *adev)
|
||||
devm_led_classdev_unregister(&adev->dev, &data->led);
|
||||
destroy_workqueue(data->wq);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct acpi_driver asus_wireless_driver = {
|
||||
|
@ -418,11 +418,11 @@ failed_sensitivity:
|
||||
return error;
|
||||
}
|
||||
|
||||
static int cmpc_accel_remove_v4(struct acpi_device *acpi)
|
||||
static void cmpc_accel_remove_v4(struct acpi_device *acpi)
|
||||
{
|
||||
device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr_v4);
|
||||
device_remove_file(&acpi->dev, &cmpc_accel_g_select_attr_v4);
|
||||
return cmpc_remove_acpi_notify_device(acpi);
|
||||
cmpc_remove_acpi_notify_device(acpi);
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(cmpc_accel_pm, cmpc_accel_suspend_v4,
|
||||
@ -648,10 +648,10 @@ failed_file:
|
||||
return error;
|
||||
}
|
||||
|
||||
static int cmpc_accel_remove(struct acpi_device *acpi)
|
||||
static void cmpc_accel_remove(struct acpi_device *acpi)
|
||||
{
|
||||
device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr);
|
||||
return cmpc_remove_acpi_notify_device(acpi);
|
||||
cmpc_remove_acpi_notify_device(acpi);
|
||||
}
|
||||
|
||||
static const struct acpi_device_id cmpc_accel_device_ids[] = {
|
||||
@ -727,9 +727,9 @@ static int cmpc_tablet_add(struct acpi_device *acpi)
|
||||
cmpc_tablet_idev_init);
|
||||
}
|
||||
|
||||
static int cmpc_tablet_remove(struct acpi_device *acpi)
|
||||
static void cmpc_tablet_remove(struct acpi_device *acpi)
|
||||
{
|
||||
return cmpc_remove_acpi_notify_device(acpi);
|
||||
cmpc_remove_acpi_notify_device(acpi);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@ -974,7 +974,7 @@ out_bd:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int cmpc_ipml_remove(struct acpi_device *acpi)
|
||||
static void cmpc_ipml_remove(struct acpi_device *acpi)
|
||||
{
|
||||
struct ipml200_dev *ipml;
|
||||
|
||||
@ -988,8 +988,6 @@ static int cmpc_ipml_remove(struct acpi_device *acpi)
|
||||
}
|
||||
|
||||
kfree(ipml);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id cmpc_ipml_device_ids[] = {
|
||||
@ -1055,9 +1053,9 @@ static int cmpc_keys_add(struct acpi_device *acpi)
|
||||
cmpc_keys_idev_init);
|
||||
}
|
||||
|
||||
static int cmpc_keys_remove(struct acpi_device *acpi)
|
||||
static void cmpc_keys_remove(struct acpi_device *acpi)
|
||||
{
|
||||
return cmpc_remove_acpi_notify_device(acpi);
|
||||
cmpc_remove_acpi_notify_device(acpi);
|
||||
}
|
||||
|
||||
static const struct acpi_device_id cmpc_keys_device_ids[] = {
|
||||
|
@ -206,7 +206,7 @@ static void rbtn_input_event(struct rbtn_data *rbtn_data)
|
||||
*/
|
||||
|
||||
static int rbtn_add(struct acpi_device *device);
|
||||
static int rbtn_remove(struct acpi_device *device);
|
||||
static void rbtn_remove(struct acpi_device *device);
|
||||
static void rbtn_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id rbtn_ids[] = {
|
||||
@ -426,7 +426,7 @@ static int rbtn_add(struct acpi_device *device)
|
||||
|
||||
}
|
||||
|
||||
static int rbtn_remove(struct acpi_device *device)
|
||||
static void rbtn_remove(struct acpi_device *device)
|
||||
{
|
||||
struct rbtn_data *rbtn_data = device->driver_data;
|
||||
|
||||
@ -443,8 +443,6 @@ static int rbtn_remove(struct acpi_device *device)
|
||||
|
||||
rbtn_acquire(device, false);
|
||||
device->driver_data = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rbtn_notify(struct acpi_device *device, u32 event)
|
||||
|
@ -1440,7 +1440,7 @@ fail_platform:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int eeepc_acpi_remove(struct acpi_device *device)
|
||||
static void eeepc_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct eeepc_laptop *eeepc = acpi_driver_data(device);
|
||||
|
||||
@ -1451,7 +1451,6 @@ static int eeepc_acpi_remove(struct acpi_device *device)
|
||||
eeepc_platform_exit(eeepc);
|
||||
|
||||
kfree(eeepc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -847,15 +847,13 @@ err_free_fifo:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int acpi_fujitsu_laptop_remove(struct acpi_device *device)
|
||||
static void acpi_fujitsu_laptop_remove(struct acpi_device *device)
|
||||
{
|
||||
struct fujitsu_laptop *priv = acpi_driver_data(device);
|
||||
|
||||
fujitsu_laptop_platform_remove(device);
|
||||
|
||||
kfifo_free(&priv->fifo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void acpi_fujitsu_laptop_press(struct acpi_device *device, int scancode)
|
||||
|
@ -484,12 +484,11 @@ static int acpi_fujitsu_add(struct acpi_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_fujitsu_remove(struct acpi_device *adev)
|
||||
static void acpi_fujitsu_remove(struct acpi_device *adev)
|
||||
{
|
||||
free_irq(fujitsu.irq, fujitsu_interrupt);
|
||||
release_region(fujitsu.io_base, fujitsu.io_length);
|
||||
input_fujitsu_remove();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -113,12 +113,10 @@ static int irst_add(struct acpi_device *acpi)
|
||||
return error;
|
||||
}
|
||||
|
||||
static int irst_remove(struct acpi_device *acpi)
|
||||
static void irst_remove(struct acpi_device *acpi)
|
||||
{
|
||||
device_remove_file(&acpi->dev, &irst_wakeup_attr);
|
||||
device_remove_file(&acpi->dev, &irst_timeout_attr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id irst_ids[] = {
|
||||
|
@ -761,7 +761,7 @@ out_platform_registered:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int acpi_remove(struct acpi_device *device)
|
||||
static void acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
sysfs_remove_group(&pf_device->dev.kobj, &dev_attribute_group);
|
||||
|
||||
@ -773,8 +773,6 @@ static int acpi_remove(struct acpi_device *device)
|
||||
platform_device_unregister(pf_device);
|
||||
pf_device = NULL;
|
||||
platform_driver_unregister(&pf_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id device_ids[] = {
|
||||
|
@ -183,7 +183,7 @@ enum SINF_BITS { SINF_NUM_BATTERIES = 0,
|
||||
/* R1 handles SINF_AC_CUR_BRIGHT as SINF_CUR_BRIGHT, doesn't know AC state */
|
||||
|
||||
static int acpi_pcc_hotkey_add(struct acpi_device *device);
|
||||
static int acpi_pcc_hotkey_remove(struct acpi_device *device);
|
||||
static void acpi_pcc_hotkey_remove(struct acpi_device *device);
|
||||
static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id pcc_device_ids[] = {
|
||||
@ -1065,12 +1065,12 @@ out_hotkey:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_pcc_hotkey_remove(struct acpi_device *device)
|
||||
static void acpi_pcc_hotkey_remove(struct acpi_device *device)
|
||||
{
|
||||
struct pcc_acpi *pcc = acpi_driver_data(device);
|
||||
|
||||
if (!device || !pcc)
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
i8042_remove_filter(panasonic_i8042_filter);
|
||||
|
||||
@ -1088,8 +1088,6 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device)
|
||||
|
||||
kfree(pcc->sinf);
|
||||
kfree(pcc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_acpi_driver(acpi_pcc_driver);
|
||||
|
@ -3263,7 +3263,7 @@ outwalk:
|
||||
return result;
|
||||
}
|
||||
|
||||
static int sony_nc_remove(struct acpi_device *device)
|
||||
static void sony_nc_remove(struct acpi_device *device)
|
||||
{
|
||||
struct sony_nc_value *item;
|
||||
|
||||
@ -3280,8 +3280,6 @@ static int sony_nc_remove(struct acpi_device *device)
|
||||
sony_pf_remove();
|
||||
sony_laptop_remove_input();
|
||||
dprintk(SONY_NC_DRIVER_NAME " removed.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id sony_device_ids[] = {
|
||||
@ -4630,14 +4628,14 @@ found:
|
||||
* ACPI driver
|
||||
*
|
||||
*****************/
|
||||
static int sony_pic_remove(struct acpi_device *device)
|
||||
static void sony_pic_remove(struct acpi_device *device)
|
||||
{
|
||||
struct sony_pic_ioport *io, *tmp_io;
|
||||
struct sony_pic_irq *irq, *tmp_irq;
|
||||
|
||||
if (sony_pic_disable(device)) {
|
||||
pr_err("Couldn't disable device\n");
|
||||
return -ENXIO;
|
||||
return;
|
||||
}
|
||||
|
||||
free_irq(spic_dev.cur_irq->irq.interrupts[0], &spic_dev);
|
||||
@ -4667,7 +4665,6 @@ static int sony_pic_remove(struct acpi_device *device)
|
||||
spic_dev.cur_irq = NULL;
|
||||
|
||||
dprintk(SONY_PIC_DRIVER_NAME " removed.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sony_pic_add(struct acpi_device *device)
|
||||
|
@ -744,7 +744,7 @@ error:
|
||||
}
|
||||
|
||||
// Remove a System76 ACPI device
|
||||
static int system76_remove(struct acpi_device *acpi_dev)
|
||||
static void system76_remove(struct acpi_device *acpi_dev)
|
||||
{
|
||||
struct system76_data *data;
|
||||
|
||||
@ -760,8 +760,6 @@ static int system76_remove(struct acpi_device *acpi_dev)
|
||||
devm_led_classdev_unregister(&acpi_dev->dev, &data->kb_led);
|
||||
|
||||
system76_get(data, "FINI");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct acpi_driver system76_driver = {
|
||||
|
@ -332,7 +332,7 @@ err_free:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int topstar_acpi_remove(struct acpi_device *device)
|
||||
static void topstar_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct topstar_laptop *topstar = acpi_driver_data(device);
|
||||
|
||||
@ -344,7 +344,6 @@ static int topstar_acpi_remove(struct acpi_device *device)
|
||||
topstar_acpi_exit(topstar);
|
||||
|
||||
kfree(topstar);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id topstar_device_ids[] = {
|
||||
|
@ -3186,7 +3186,7 @@ static void print_supported_features(struct toshiba_acpi_dev *dev)
|
||||
pr_cont("\n");
|
||||
}
|
||||
|
||||
static int toshiba_acpi_remove(struct acpi_device *acpi_dev)
|
||||
static void toshiba_acpi_remove(struct acpi_device *acpi_dev)
|
||||
{
|
||||
struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev);
|
||||
|
||||
@ -3234,8 +3234,6 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev)
|
||||
toshiba_acpi = NULL;
|
||||
|
||||
kfree(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *find_hci_method(acpi_handle handle)
|
||||
|
@ -36,7 +36,7 @@ struct toshiba_bluetooth_dev {
|
||||
};
|
||||
|
||||
static int toshiba_bt_rfkill_add(struct acpi_device *device);
|
||||
static int toshiba_bt_rfkill_remove(struct acpi_device *device);
|
||||
static void toshiba_bt_rfkill_remove(struct acpi_device *device);
|
||||
static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id bt_device_ids[] = {
|
||||
@ -279,7 +279,7 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int toshiba_bt_rfkill_remove(struct acpi_device *device)
|
||||
static void toshiba_bt_rfkill_remove(struct acpi_device *device)
|
||||
{
|
||||
struct toshiba_bluetooth_dev *bt_dev = acpi_driver_data(device);
|
||||
|
||||
@ -291,7 +291,7 @@ static int toshiba_bt_rfkill_remove(struct acpi_device *device)
|
||||
|
||||
kfree(bt_dev);
|
||||
|
||||
return toshiba_bluetooth_disable(device->handle);
|
||||
toshiba_bluetooth_disable(device->handle);
|
||||
}
|
||||
|
||||
module_acpi_driver(toshiba_bt_rfkill_driver);
|
||||
|
@ -138,14 +138,12 @@ static void toshiba_haps_notify(struct acpi_device *device, u32 event)
|
||||
event, 0);
|
||||
}
|
||||
|
||||
static int toshiba_haps_remove(struct acpi_device *device)
|
||||
static void toshiba_haps_remove(struct acpi_device *device)
|
||||
{
|
||||
sysfs_remove_group(&device->dev.kobj, &haps_attr_group);
|
||||
|
||||
if (toshiba_haps)
|
||||
toshiba_haps = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Helper function */
|
||||
|
@ -83,10 +83,9 @@ static int wl_add(struct acpi_device *device)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int wl_remove(struct acpi_device *device)
|
||||
static void wl_remove(struct acpi_device *device)
|
||||
{
|
||||
wireless_input_destroy();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct acpi_driver wl_driver = {
|
||||
|
@ -143,13 +143,12 @@ static int ebook_switch_add(struct acpi_device *device)
|
||||
return error;
|
||||
}
|
||||
|
||||
static int ebook_switch_remove(struct acpi_device *device)
|
||||
static void ebook_switch_remove(struct acpi_device *device)
|
||||
{
|
||||
struct ebook_switch *button = acpi_driver_data(device);
|
||||
|
||||
input_unregister_device(button->input);
|
||||
kfree(button);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct acpi_driver xo15_ebook_driver = {
|
||||
|
@ -101,10 +101,9 @@ static int ptp_vmw_acpi_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ptp_vmw_acpi_remove(struct acpi_device *device)
|
||||
static void ptp_vmw_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
ptp_clock_unregister(ptp_vmw_clock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id ptp_vmw_acpi_device_ids[] = {
|
||||
|
@ -179,22 +179,20 @@ static int intel_menlow_memory_add(struct acpi_device *device)
|
||||
|
||||
}
|
||||
|
||||
static int intel_menlow_memory_remove(struct acpi_device *device)
|
||||
static void intel_menlow_memory_remove(struct acpi_device *device)
|
||||
{
|
||||
struct thermal_cooling_device *cdev;
|
||||
|
||||
if (!device)
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
cdev = acpi_driver_data(device);
|
||||
if (!cdev)
|
||||
return -EINVAL;
|
||||
return;
|
||||
|
||||
sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
|
||||
sysfs_remove_link(&cdev->device.kobj, "device");
|
||||
thermal_cooling_device_unregister(cdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id intel_menlow_memory_ids[] = {
|
||||
|
@ -193,13 +193,12 @@ static int apple_bl_add(struct acpi_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int apple_bl_remove(struct acpi_device *dev)
|
||||
static void apple_bl_remove(struct acpi_device *dev)
|
||||
{
|
||||
backlight_device_unregister(apple_backlight_device);
|
||||
|
||||
release_region(hw_data->iostart, hw_data->iolen);
|
||||
hw_data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id apple_bl_ids[] = {
|
||||
|
@ -224,14 +224,12 @@ static int ni903x_acpi_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ni903x_acpi_remove(struct acpi_device *device)
|
||||
static void ni903x_acpi_remove(struct acpi_device *device)
|
||||
{
|
||||
struct ni903x_wdt *wdt = acpi_driver_data(device);
|
||||
|
||||
ni903x_wdd_stop(&wdt->wdd);
|
||||
watchdog_unregister_device(&wdt->wdd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id ni903x_device_ids[] = {
|
||||
|
@ -122,7 +122,7 @@ static int acpi_pad_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_pad_remove(struct acpi_device *device)
|
||||
static void acpi_pad_remove(struct acpi_device *device)
|
||||
{
|
||||
mutex_lock(&xen_cpu_lock);
|
||||
xen_acpi_pad_idle_cpus(0);
|
||||
@ -130,7 +130,6 @@ static int acpi_pad_remove(struct acpi_device *device)
|
||||
|
||||
acpi_remove_notify_handler(device->handle,
|
||||
ACPI_DEVICE_NOTIFY, acpi_pad_notify);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id pad_device_ids[] = {
|
||||
|
@ -149,7 +149,7 @@ struct acpi_hotplug_context {
|
||||
*/
|
||||
|
||||
typedef int (*acpi_op_add) (struct acpi_device * device);
|
||||
typedef int (*acpi_op_remove) (struct acpi_device * device);
|
||||
typedef void (*acpi_op_remove) (struct acpi_device *device);
|
||||
typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
|
||||
|
||||
struct acpi_device_ops {
|
||||
|
Loading…
Reference in New Issue
Block a user