Skip to content

Commit 6c0eb5b

Browse files
Dawei Lirafaeljw
authored andcommitted
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 fc7a620 ("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 <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Dawei Li <[email protected]> Reviewed-by: Maximilian Luz <[email protected]> # for drivers/platform/surface/* Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent d7d4332 commit 6c0eb5b

Some content is hidden

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

48 files changed

+88
-149
lines changed

arch/ia64/hp/common/aml_nfw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ static int aml_nfw_add(struct acpi_device *device)
187187
return aml_nfw_add_global_handler();
188188
}
189189

190-
static int aml_nfw_remove(struct acpi_device *device)
190+
static void aml_nfw_remove(struct acpi_device *device)
191191
{
192-
return aml_nfw_remove_global_handler();
192+
aml_nfw_remove_global_handler();
193193
}
194194

195195
static const struct acpi_device_id aml_nfw_ids[] = {

arch/x86/platform/olpc/olpc-xo15-sci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ static int xo15_sci_add(struct acpi_device *device)
183183
return r;
184184
}
185185

186-
static int xo15_sci_remove(struct acpi_device *device)
186+
static void xo15_sci_remove(struct acpi_device *device)
187187
{
188188
acpi_disable_gpe(NULL, xo15_sci_gpe);
189189
acpi_remove_gpe_handler(NULL, xo15_sci_gpe, xo15_sci_gpe_handler);
190190
cancel_work_sync(&sci_work);
191191
sysfs_remove_file(&device->dev.kobj, &lid_wake_on_close_attr.attr);
192-
return 0;
193192
}
194193

195194
#ifdef CONFIG_PM_SLEEP

drivers/acpi/ac.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ MODULE_DESCRIPTION("ACPI AC Adapter Driver");
3333
MODULE_LICENSE("GPL");
3434

3535
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);
3737
static void acpi_ac_notify(struct acpi_device *device, u32 event);
3838

3939
static const struct acpi_device_id ac_device_ids[] = {
@@ -288,21 +288,19 @@ static int acpi_ac_resume(struct device *dev)
288288
#define acpi_ac_resume NULL
289289
#endif
290290

291-
static int acpi_ac_remove(struct acpi_device *device)
291+
static void acpi_ac_remove(struct acpi_device *device)
292292
{
293293
struct acpi_ac *ac = NULL;
294294

295295
if (!device || !acpi_driver_data(device))
296-
return -EINVAL;
296+
return;
297297

298298
ac = acpi_driver_data(device);
299299

300300
power_supply_unregister(ac->charger);
301301
unregister_acpi_notifier(&ac->battery_nb);
302302

303303
kfree(ac);
304-
305-
return 0;
306304
}
307305

308306
static int __init acpi_ac_init(void)

drivers/acpi/acpi_pad.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static int acpi_pad_add(struct acpi_device *device)
449449
return 0;
450450
}
451451

452-
static int acpi_pad_remove(struct acpi_device *device)
452+
static void acpi_pad_remove(struct acpi_device *device)
453453
{
454454
mutex_lock(&isolated_cpus_lock);
455455
acpi_pad_idle_cpus(0);
@@ -458,7 +458,6 @@ static int acpi_pad_remove(struct acpi_device *device)
458458
acpi_remove_notify_handler(device->handle,
459459
ACPI_DEVICE_NOTIFY, acpi_pad_notify);
460460
acpi_pad_remove_sysfs(device);
461-
return 0;
462461
}
463462

464463
static const struct acpi_device_id pad_device_ids[] = {

drivers/acpi/acpi_video.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static DEFINE_MUTEX(register_count_mutex);
8686
static DEFINE_MUTEX(video_list_lock);
8787
static LIST_HEAD(video_bus_head);
8888
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);
9090
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
9191
static void acpi_video_bus_register_backlight_work(struct work_struct *ignored);
9292
static DECLARE_DELAYED_WORK(video_bus_register_backlight_work,
@@ -2067,13 +2067,13 @@ static int acpi_video_bus_add(struct acpi_device *device)
20672067
return error;
20682068
}
20692069

2070-
static int acpi_video_bus_remove(struct acpi_device *device)
2070+
static void acpi_video_bus_remove(struct acpi_device *device)
20712071
{
20722072
struct acpi_video_bus *video = NULL;
20732073

20742074

20752075
if (!device || !acpi_driver_data(device))
2076-
return -EINVAL;
2076+
return;
20772077

20782078
video = acpi_driver_data(device);
20792079

@@ -2087,8 +2087,6 @@ static int acpi_video_bus_remove(struct acpi_device *device)
20872087

20882088
kfree(video->attached_array);
20892089
kfree(video);
2090-
2091-
return 0;
20922090
}
20932091

20942092
static void acpi_video_bus_register_backlight_work(struct work_struct *ignored)

drivers/acpi/battery.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,20 +1208,19 @@ static int acpi_battery_add(struct acpi_device *device)
12081208
return result;
12091209
}
12101210

1211-
static int acpi_battery_remove(struct acpi_device *device)
1211+
static void acpi_battery_remove(struct acpi_device *device)
12121212
{
12131213
struct acpi_battery *battery = NULL;
12141214

12151215
if (!device || !acpi_driver_data(device))
1216-
return -EINVAL;
1216+
return;
12171217
device_init_wakeup(&device->dev, 0);
12181218
battery = acpi_driver_data(device);
12191219
unregister_pm_notifier(&battery->pm_nb);
12201220
sysfs_remove_battery(battery);
12211221
mutex_destroy(&battery->lock);
12221222
mutex_destroy(&battery->sysfs_lock);
12231223
kfree(battery);
1224-
return 0;
12251224
}
12261225

12271226
#ifdef CONFIG_PM_SLEEP

drivers/acpi/button.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
125125
};
126126

127127
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);
129129
static void acpi_button_notify(struct acpi_device *device, u32 event);
130130

131131
#ifdef CONFIG_PM_SLEEP
@@ -580,14 +580,13 @@ static int acpi_button_add(struct acpi_device *device)
580580
return error;
581581
}
582582

583-
static int acpi_button_remove(struct acpi_device *device)
583+
static void acpi_button_remove(struct acpi_device *device)
584584
{
585585
struct acpi_button *button = acpi_driver_data(device);
586586

587587
acpi_button_remove_fs(device);
588588
input_unregister_device(button->input);
589589
kfree(button);
590-
return 0;
591590
}
592591

593592
static int param_set_lid_init_state(const char *val,

drivers/acpi/ec.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,12 +1663,12 @@ static int acpi_ec_add(struct acpi_device *device)
16631663
return ret;
16641664
}
16651665

1666-
static int acpi_ec_remove(struct acpi_device *device)
1666+
static void acpi_ec_remove(struct acpi_device *device)
16671667
{
16681668
struct acpi_ec *ec;
16691669

16701670
if (!device)
1671-
return -EINVAL;
1671+
return;
16721672

16731673
ec = acpi_driver_data(device);
16741674
release_region(ec->data_addr, 1);
@@ -1678,7 +1678,6 @@ static int acpi_ec_remove(struct acpi_device *device)
16781678
ec_remove_handlers(ec);
16791679
acpi_ec_free(ec);
16801680
}
1681-
return 0;
16821681
}
16831682

16841683
static acpi_status

drivers/acpi/hed.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ static int acpi_hed_add(struct acpi_device *device)
5656
return 0;
5757
}
5858

59-
static int acpi_hed_remove(struct acpi_device *device)
59+
static void acpi_hed_remove(struct acpi_device *device)
6060
{
6161
hed_handle = NULL;
62-
return 0;
6362
}
6463

6564
static struct acpi_driver acpi_hed_driver = {

drivers/acpi/nfit/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3371,10 +3371,9 @@ static int acpi_nfit_add(struct acpi_device *adev)
33713371
return devm_add_action_or_reset(dev, acpi_nfit_shutdown, acpi_desc);
33723372
}
33733373

3374-
static int acpi_nfit_remove(struct acpi_device *adev)
3374+
static void acpi_nfit_remove(struct acpi_device *adev)
33753375
{
33763376
/* see acpi_nfit_unregister */
3377-
return 0;
33783377
}
33793378

33803379
static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle)

0 commit comments

Comments
 (0)