diff options
Diffstat (limited to 'drivers/misc/sony-laptop.c')
-rw-r--r-- | drivers/misc/sony-laptop.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 43315be3dc11..5300cad9cd7f 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -864,6 +864,15 @@ static int sony_nc_add(struct acpi_device *device) | |||
864 | 864 | ||
865 | sony_nc_acpi_handle = device->handle; | 865 | sony_nc_acpi_handle = device->handle; |
866 | 866 | ||
867 | /* read device status */ | ||
868 | result = acpi_bus_get_status(device); | ||
869 | /* bail IFF the above call was successful and the device is not present */ | ||
870 | if (!result && !device->status.present) { | ||
871 | dprintk("Device not present\n"); | ||
872 | result = -ENODEV; | ||
873 | goto outwalk; | ||
874 | } | ||
875 | |||
867 | if (debug) { | 876 | if (debug) { |
868 | status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_nc_acpi_handle, | 877 | status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_nc_acpi_handle, |
869 | 1, sony_walk_callback, NULL, NULL); | 878 | 1, sony_walk_callback, NULL, NULL); |
@@ -874,6 +883,15 @@ static int sony_nc_add(struct acpi_device *device) | |||
874 | } | 883 | } |
875 | } | 884 | } |
876 | 885 | ||
886 | /* try to _INI the device if such method exists (ACPI spec 3.0-6.5.1 | ||
887 | * should be respected as we already checked for the device presence above */ | ||
888 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, METHOD_NAME__INI, &handle))) { | ||
889 | dprintk("Invoking _INI\n"); | ||
890 | if (ACPI_FAILURE(acpi_evaluate_object(sony_nc_acpi_handle, METHOD_NAME__INI, | ||
891 | NULL, NULL))) | ||
892 | dprintk("_INI Method failed\n"); | ||
893 | } | ||
894 | |||
877 | /* setup input devices and helper fifo */ | 895 | /* setup input devices and helper fifo */ |
878 | result = sony_laptop_setup_input(); | 896 | result = sony_laptop_setup_input(); |
879 | if (result) { | 897 | if (result) { |
@@ -886,7 +904,7 @@ static int sony_nc_add(struct acpi_device *device) | |||
886 | ACPI_DEVICE_NOTIFY, | 904 | ACPI_DEVICE_NOTIFY, |
887 | sony_acpi_notify, NULL); | 905 | sony_acpi_notify, NULL); |
888 | if (ACPI_FAILURE(status)) { | 906 | if (ACPI_FAILURE(status)) { |
889 | printk(KERN_WARNING DRV_PFX "unable to install notify handler\n"); | 907 | printk(KERN_WARNING DRV_PFX "unable to install notify handler (%u)\n", status); |
890 | result = -ENODEV; | 908 | result = -ENODEV; |
891 | goto outinput; | 909 | goto outinput; |
892 | } | 910 | } |