From f767d55fd160ac8ae8c4d9fd329bdf6040fd0b46 Mon Sep 17 00:00:00 2001 From: Toshi Kani Date: Tue, 23 Oct 2012 01:30:26 +0200 Subject: [PATCH] --- yaml --- r: 336666 b: refs/heads/master c: 8ab0ab2570cfc48303e545944f53690a6983a898 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/dock.c | 26 +++++++------------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index 6570e3bc5b92..56a30196514b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a3cd8d2789c2e265e09377f260e7d2ac9cec81bb +refs/heads/master: 8ab0ab2570cfc48303e545944f53690a6983a898 diff --git a/trunk/drivers/acpi/dock.c b/trunk/drivers/acpi/dock.c index 88eb14304667..ae4ebf2d4cd2 100644 --- a/trunk/drivers/acpi/dock.c +++ b/trunk/drivers/acpi/dock.c @@ -1016,44 +1016,32 @@ static int dock_remove(struct dock_station *ds) } /** - * find_dock - look for a dock station + * find_dock_and_bay - look for dock stations and bays * @handle: acpi handle of a device * @lvl: unused - * @context: counter of dock stations found + * @context: unused * @rv: unused * - * This is called by acpi_walk_namespace to look for dock stations. + * This is called by acpi_walk_namespace to look for dock stations and bays. */ static __init acpi_status -find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) +find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv) { - if (is_dock(handle)) + if (is_dock(handle) || is_ejectable_bay(handle)) dock_add(handle); return AE_OK; } -static __init acpi_status -find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) -{ - /* If bay is a dock, it's already handled */ - if (is_ejectable_bay(handle) && !is_dock(handle)) - dock_add(handle); - return AE_OK; -} - static int __init dock_init(void) { if (acpi_disabled) return 0; - /* look for a dock station */ + /* look for dock stations and bays */ acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, find_dock, NULL, NULL, NULL); + ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL); - /* look for bay */ - acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, find_bay, NULL, NULL, NULL); if (!dock_station_count) { printk(KERN_INFO PREFIX "No dock devices found.\n"); return 0;