summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/dell-wmi.c
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@dell.com>2017-11-09 18:49:10 +0100
committerDarren Hart (VMware) <dvhart@infradead.org>2017-11-17 02:45:26 +0100
commit868b8d33f91e431b1961a35baa6b5022639067f3 (patch)
treea49852abaa758657c61145842cfd73094f0bd3e9 /drivers/platform/x86/dell-wmi.c
parentplatform/x86: dell-wmi-descriptor: check if memory was allocated (diff)
downloadlinux-868b8d33f91e431b1961a35baa6b5022639067f3.tar.xz
linux-868b8d33f91e431b1961a35baa6b5022639067f3.zip
platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
dell-wmi and dell-smbios-wmi are dependent upon dell-wmi-descriptor finishing probe successfully to probe themselves. Currently if dell-wmi-descriptor fails probing in a non-recoverable way (such as invalid header) dell-wmi and dell-smbios-wmi will continue to try to redo probing due to deferred probing. To solve this have the dependent drivers query the dell-wmi-descriptor driver whether the descriptor has been determined valid. The possible results are: -ENODEV: Descriptor GUID missing from WMI bus -EPROBE_DEFER: Descriptor not yet probed, dependent driver should wait and use deferred probing < 0: Descriptor probed, invalid. Dependent driver should return an error. 0: Successful descriptor probe, dependent driver can continue Successful descriptor probe still doesn't mean that the descriptor driver is necessarily bound at the time of initialization of dependent driver. Userspace can unbind the driver, so all methods used from driver should still be verified to return success values otherwise deferred probing be used. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/dell-wmi.c')
-rw-r--r--drivers/platform/x86/dell-wmi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 54321080a30d..39d2f4518483 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -655,9 +655,11 @@ static int dell_wmi_events_set_enabled(bool enable)
static int dell_wmi_probe(struct wmi_device *wdev)
{
struct dell_wmi_priv *priv;
+ int ret;
- if (!wmi_has_guid(DELL_WMI_DESCRIPTOR_GUID))
- return -ENODEV;
+ ret = dell_wmi_get_descriptor_valid();
+ if (ret)
+ return ret;
priv = devm_kzalloc(
&wdev->dev, sizeof(struct dell_wmi_priv), GFP_KERNEL);