diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-15 18:21:24 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-15 18:21:24 -0500 |
commit | d6a40224a30687f6e0471c4476e3a1a9adc28a96 (patch) | |
tree | 79b9f0ac06f0394ce136f694e063952fd34c54fa /drivers | |
parent | 4b49b9fe2b5220374ddc1c122cc31e00cc20365f (diff) | |
parent | ab62f9cd7b5ecdf853f1612fe1e983cb7cbbac3e (diff) |
Merge back earlier 'acpi-dock' material.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/dock.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index c431c88faaff..5bfd769fc91f 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -609,7 +609,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event) | |||
609 | static void dock_notify(struct dock_station *ds, u32 event) | 609 | static void dock_notify(struct dock_station *ds, u32 event) |
610 | { | 610 | { |
611 | acpi_handle handle = ds->handle; | 611 | acpi_handle handle = ds->handle; |
612 | struct acpi_device *ad; | 612 | struct acpi_device *adev = NULL; |
613 | int surprise_removal = 0; | 613 | int surprise_removal = 0; |
614 | 614 | ||
615 | /* | 615 | /* |
@@ -632,7 +632,8 @@ static void dock_notify(struct dock_station *ds, u32 event) | |||
632 | switch (event) { | 632 | switch (event) { |
633 | case ACPI_NOTIFY_BUS_CHECK: | 633 | case ACPI_NOTIFY_BUS_CHECK: |
634 | case ACPI_NOTIFY_DEVICE_CHECK: | 634 | case ACPI_NOTIFY_DEVICE_CHECK: |
635 | if (!dock_in_progress(ds) && acpi_bus_get_device(handle, &ad)) { | 635 | acpi_bus_get_device(handle, &adev); |
636 | if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) { | ||
636 | begin_dock(ds); | 637 | begin_dock(ds); |
637 | dock(ds); | 638 | dock(ds); |
638 | if (!dock_present(ds)) { | 639 | if (!dock_present(ds)) { |
@@ -712,13 +713,11 @@ static acpi_status __init find_dock_devices(acpi_handle handle, u32 lvl, | |||
712 | static ssize_t show_docked(struct device *dev, | 713 | static ssize_t show_docked(struct device *dev, |
713 | struct device_attribute *attr, char *buf) | 714 | struct device_attribute *attr, char *buf) |
714 | { | 715 | { |
715 | struct acpi_device *tmp; | ||
716 | |||
717 | struct dock_station *dock_station = dev->platform_data; | 716 | struct dock_station *dock_station = dev->platform_data; |
717 | struct acpi_device *adev = NULL; | ||
718 | 718 | ||
719 | if (!acpi_bus_get_device(dock_station->handle, &tmp)) | 719 | acpi_bus_get_device(dock_station->handle, &adev); |
720 | return snprintf(buf, PAGE_SIZE, "1\n"); | 720 | return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev)); |
721 | return snprintf(buf, PAGE_SIZE, "0\n"); | ||
722 | } | 721 | } |
723 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); | 722 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); |
724 | 723 | ||