]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: wmi: Instantiate all devices before adding them
authorDarren Hart (VMware) <dvhart@infradead.org>
Tue, 6 Jun 2017 17:13:49 +0000 (10:13 -0700)
committerDarren Hart (VMware) <dvhart@infradead.org>
Tue, 6 Jun 2017 17:15:19 +0000 (10:15 -0700)
commit96016d1e2579c72d2059d9f3323330f12f9b5b16
tree95b2fe7faedc95aaa75a2971edabff4397402d28
parentf9ac95bbdbb4dc15364f104a444e028b29f90902
platform/x86: wmi: Instantiate all devices before adding them

At some point, we will want sub-drivers to get references to other
devices on the same WMI bus. This change is needed to avoid races.

This ends up simplifying the setup code and fixing some leaks, too.

This is based on the original work of Andy Lutomirski <luto@kernel.org>,
but includes several modifications, many in response to review from
Michał Kępień <kernel@kempniu.pl>:

  https://www.spinics.net/lists/platform-driver-x86/msg08201.html

Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/platform/x86/wmi.c