@@ -338,9 +338,6 @@ static int __init acpi_ac_init(void)
{
int result;
- if (acpi_disabled)
- return -ENODEV;
-
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
@@ -352,7 +349,7 @@ static int __init acpi_ac_init(void)
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_unlock_ac_dir(acpi_ac_dir);
#endif
- return -ENODEV;
+ return result;
}
return 0;
@@ -526,7 +526,7 @@ static int __init acpi_memory_device_init(void)
result = acpi_bus_register_driver(&acpi_memory_device_driver);
if (result < 0)
- return -ENODEV;
+ return result;
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX,
@@ -907,8 +907,6 @@ static struct acpi_driver acpi_battery_driver = {
static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
{
- if (acpi_disabled)
- return;
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_battery_dir = acpi_lock_battery_dir();
if (!acpi_battery_dir)
@@ -245,7 +245,7 @@ static int __init acpi_container_init(void)
result = acpi_bus_register_driver(&acpi_container_driver);
if (result < 0) {
- return (result);
+ return result;
}
/* register notify handler to every container device */
@@ -254,7 +254,7 @@ static int __init acpi_container_init(void)
ACPI_UINT32_MAX,
container_walk_namespace_cb, &action, NULL);
- return (0);
+ return 0;
}
static void __exit acpi_container_exit(void)
@@ -1010,7 +1010,7 @@ int __init acpi_ec_init(void)
result = acpi_bus_register_driver(&acpi_ec_driver);
if (result < 0) {
remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
- return -ENODEV;
+ return result;
}
return result;
@@ -345,7 +345,7 @@ static int __init acpi_fan_init(void)
result = acpi_bus_register_driver(&acpi_fan_driver);
if (result < 0) {
remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
- return -ENODEV;
+ return result;
}
return 0;
@@ -769,9 +769,7 @@ static int irqrouter_resume(struct sys_device *dev)
static int acpi_pci_link_remove(struct acpi_device *device, int type)
{
- struct acpi_pci_link *link;
-
- link = acpi_driver_data(device);
+ struct acpi_pci_link *link = acpi_driver_data(device);
mutex_lock(&acpi_link_lock);
list_del(&link->list);
@@ -900,6 +898,8 @@ device_initcall(irqrouter_init_sysfs);
static int __init acpi_pci_link_init(void)
{
+ int result;
+
if (acpi_noirq)
return 0;
@@ -911,8 +911,9 @@ static int __init acpi_pci_link_init(void)
acpi_irq_balance = 0;
}
- if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0)
- return -ENODEV;
+ result = acpi_bus_register_driver(&acpi_pci_link_driver);
+ if (result < 0)
+ return result;
return 0;
}
@@ -747,7 +747,7 @@ int __init acpi_power_init(void)
result = acpi_bus_register_driver(&acpi_power_driver);
if (result < 0) {
remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);
- return -ENODEV;
+ return result;
}
return 0;
@@ -1013,8 +1013,6 @@ static int __init acpi_sbs_init(void)
{
int result = 0;
- if (acpi_disabled)
- return -ENODEV;
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
@@ -1028,7 +1026,7 @@ static int __init acpi_sbs_init(void)
result = acpi_bus_register_driver(&acpi_sbs_driver);
if (result < 0) {
acpi_sbs_rmdirs();
- return -ENODEV;
+ return result;
}
return 0;
}
@@ -302,12 +302,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type)
static int __init acpi_smb_hc_init(void)
{
- int result;
-
- result = acpi_bus_register_driver(&acpi_smb_hc_driver);
- if (result < 0)
- return -ENODEV;
- return 0;
+ return acpi_bus_register_driver(&acpi_smb_hc_driver);
}
static void __exit acpi_smb_hc_exit(void)
@@ -1534,7 +1534,7 @@ static int __init acpi_thermal_init(void)
result = acpi_bus_register_driver(&acpi_thermal_driver);
if (result < 0) {
remove_proc_entry(ACPI_THERMAL_CLASS, acpi_root_dir);
- return -ENODEV;
+ return result;
}
return 0;
@@ -2398,7 +2398,7 @@ int acpi_video_register(void)
result = acpi_bus_register_driver(&acpi_video_bus);
if (result < 0) {
remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir);
- return -ENODEV;
+ return result;
}
/*
@@ -993,13 +993,7 @@ static int atk_remove(struct acpi_device *device, int type)
static int __init atk0110_init(void)
{
- int ret;
-
- ret = acpi_bus_register_driver(&atk_driver);
- if (ret)
- pr_info("atk: acpi_bus_register_driver failed: %d\n", ret);
-
- return ret;
+ return acpi_bus_register_driver(&atk_driver);
}
static void __exit atk0110_exit(void)
@@ -357,9 +357,6 @@ static int __init lis3lv02d_init_module(void)
{
int ret;
- if (acpi_disabled)
- return -ENODEV;
-
ret = acpi_bus_register_driver(&lis3lv02d_driver);
if (ret < 0)
return ret;
@@ -154,18 +154,7 @@ static struct acpi_driver atlas_acpi_driver = {
static int __init atlas_acpi_init(void)
{
- int result;
-
- if (acpi_disabled)
- return -ENODEV;
-
- result = acpi_bus_register_driver(&atlas_acpi_driver);
- if (result < 0) {
- printk(KERN_ERR "Atlas ACPI: Unable to register driver\n");
- return -ENODEV;
- }
-
- return 0;
+ return acpi_bus_register_driver(&atlas_acpi_driver);
}
static void __exit atlas_acpi_exit(void)
@@ -1438,9 +1438,6 @@ static int __init asus_laptop_init(void)
{
int result;
- if (acpi_disabled)
- return -ENODEV;
-
result = acpi_bus_register_driver(&asus_hotk_driver);
if (result < 0)
return result;
@@ -1416,9 +1416,6 @@ static int __init asus_acpi_init(void)
{
int result;
- if (acpi_disabled)
- return -ENODEV;
-
asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
if (!asus_proc_dir) {
printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
@@ -1291,8 +1291,6 @@ static int __init eeepc_laptop_init(void)
{
int result;
- if (acpi_disabled)
- return -ENODEV;
result = acpi_bus_register_driver(&eeepc_hotk_driver);
if (result < 0)
return result;
@@ -678,19 +678,7 @@ out_hotkey:
static int __init acpi_pcc_init(void)
{
- int result = 0;
-
- if (acpi_disabled)
- return -ENODEV;
-
- result = acpi_bus_register_driver(&acpi_pcc_driver);
- if (result < 0) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
- "Error registering hotkey driver\n"));
- return -ENODEV;
- }
-
- return 0;
+ return acpi_bus_register_driver(&acpi_pcc_driver);
}
static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type)
@@ -702,9 +702,6 @@ static int __init acpi_wmi_init(void)
INIT_LIST_HEAD(&wmi_blocks.list);
- if (acpi_disabled)
- return -ENODEV;
-
result = acpi_bus_register_driver(&acpi_wmi_driver);
if (result < 0) {