Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165227
b: refs/heads/master
c: 1e77985
h: refs/heads/master
i:
  165225: 570b76e
  165223: 9bcab3c
v: v3
  • Loading branch information
Alan Jenkins authored and Len Brown committed Aug 28, 2009
1 parent b633306 commit 5084c35
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07e84aa98f6b3a7278d3267f6f657955ed3eb973
refs/heads/master: 1e7798547fe6920ae27fb92c9202353e9e4c55db
120 changes: 59 additions & 61 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,44 +847,6 @@ static int eeepc_setup_pci_hotplug(void)
return ret;
}

static int eeepc_hotk_add(struct acpi_device *device)
{
int result;

if (!device)
return -EINVAL;
pr_notice(EEEPC_HOTK_NAME "\n");
ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL);
if (!ehotk)
return -ENOMEM;
ehotk->init_flag = DISABLE_ASL_WLAN | DISABLE_ASL_DISPLAYSWITCH;
ehotk->handle = device->handle;
strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME);
strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS);
device->driver_data = ehotk;
ehotk->device = device;
result = eeepc_hotk_check();
if (result)
goto ehotk_fail;

return 0;

ehotk_fail:
kfree(ehotk);
ehotk = NULL;

return result;
}

static int eeepc_hotk_remove(struct acpi_device *device, int type)
{
if (!device || !acpi_driver_data(device))
return -EINVAL;

kfree(ehotk);
return 0;
}

static int eeepc_hotk_resume(struct acpi_device *device)
{
if (ehotk->wlan_rfkill) {
Expand Down Expand Up @@ -1066,19 +1028,6 @@ static void eeepc_hwmon_exit(void)
eeepc_hwmon_device = NULL;
}

static void __exit eeepc_laptop_exit(void)
{
eeepc_backlight_exit();
eeepc_rfkill_exit();
eeepc_input_exit();
eeepc_hwmon_exit();
acpi_bus_unregister_driver(&eeepc_hotk_driver);
sysfs_remove_group(&platform_device->dev.kobj,
&platform_attribute_group);
platform_device_unregister(platform_device);
platform_driver_unregister(&platform_driver);
}

static int eeepc_new_rfkill(struct rfkill **rfkill,
const char *name, struct device *dev,
enum rfkill_type type, int cm)
Expand Down Expand Up @@ -1193,21 +1142,27 @@ static int eeepc_hwmon_init(struct device *dev)
return result;
}

static int __init eeepc_laptop_init(void)
static int eeepc_hotk_add(struct acpi_device *device)
{
struct device *dev;
int result;

if (acpi_disabled)
return -ENODEV;
result = acpi_bus_register_driver(&eeepc_hotk_driver);
if (result < 0)
return result;
if (!ehotk) {
acpi_bus_unregister_driver(&eeepc_hotk_driver);
return -ENODEV;
}
if (!device)
return -EINVAL;
pr_notice(EEEPC_HOTK_NAME "\n");
ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL);
if (!ehotk)
return -ENOMEM;
ehotk->init_flag = DISABLE_ASL_WLAN | DISABLE_ASL_DISPLAYSWITCH;
ehotk->handle = device->handle;
strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME);
strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS);
device->driver_data = ehotk;
ehotk->device = device;

result = eeepc_hotk_check();
if (result)
goto fail_check;
eeepc_enable_camera();

/* Register platform stuff */
Expand Down Expand Up @@ -1246,6 +1201,7 @@ static int __init eeepc_laptop_init(void)
goto fail_rfkill;

return 0;

fail_rfkill:
eeepc_hwmon_exit();
fail_hwmon:
Expand All @@ -1261,8 +1217,50 @@ static int __init eeepc_laptop_init(void)
platform_driver_unregister(&platform_driver);
fail_platform_driver:
eeepc_input_exit();
fail_check:
kfree(ehotk);

return result;
}

static int eeepc_hotk_remove(struct acpi_device *device, int type)
{
if (!device || !acpi_driver_data(device))
return -EINVAL;

eeepc_backlight_exit();
eeepc_rfkill_exit();
eeepc_input_exit();
eeepc_hwmon_exit();
sysfs_remove_group(&platform_device->dev.kobj,
&platform_attribute_group);
platform_device_unregister(platform_device);
platform_driver_unregister(&platform_driver);

kfree(ehotk);
return 0;
}

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;
if (!ehotk) {
acpi_bus_unregister_driver(&eeepc_hotk_driver);
return -ENODEV;
}
return 0;
}

static void __exit eeepc_laptop_exit(void)
{
acpi_bus_unregister_driver(&eeepc_hotk_driver);
}

module_init(eeepc_laptop_init);
module_exit(eeepc_laptop_exit);

0 comments on commit 5084c35

Please sign in to comment.